Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update heap.js#114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
amejiarosario merged 1 commit intoamejiarosario:masterfromBalaji1202:patch-1
Dec 20, 2022
Merged

Conversation

Balaji1202
Copy link
Contributor

Fix proper parent index fetching

Fix proper parent index fetching
@amejiarosario
Copy link
Owner

Hi@Balaji1202! Thanks a lot for the fix. Could you please add a unit test that captures this bug fix?

@Balaji1202
Copy link
ContributorAuthor

Hey@amejiarosario!

The issue seems to be a little complicated and the ceil operation is little weird from javascript side too.

The operationMath.ceil(i / 2 - 1) is a lot similar toMath.ceil(i / 2) - 1 both in terms of BODMAS rule and javascript execution of Math.ceil method.

But, for an input of 1, the javascript engine equates Math.ceil(-0.5) to negative zero-0 (validity of negative zero is debatable). But, since 0 equals -0, your validation seems to pass for all inputs.

So, I feel my fix may not add any value since there is not any issue in first place. But, if you are worried about reading confusion for your readers with the priority of the execution in the statement, think about merging it. Else feel free to close the PR.

:>)
Thanks!

@amejiarosario
Copy link
Owner

Ah, I see now where you are coming from. I agree this change makes it easier to reason about. Also, it avoids the weird-0 case. Thanks for taking the time to explain and creating the PR

Balaji1202 reacted with hooray emoji

@amejiarosarioamejiarosario merged commitc20acfb intoamejiarosario:masterDec 20, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Balaji1202@amejiarosario

[8]ページ先頭

©2009-2025 Movatter.jp