Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add constants/float64/num-high-word-significand-bits #2889

Merged
merged 8 commits into from
Sep 16, 2024

Conversation

gunjjoshi
Copy link
Member

@gunjjoshi gunjjoshi commented Sep 9, 2024

Description

What is the purpose of this pull request?

This pull request:

FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS = 20;

Related Issues

Does this pull request have any related issues?

None.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@kgryte kgryte added the Feature Issue or pull request for adding a new feature. label Sep 14, 2024
@kgryte
Copy link
Member

kgryte commented Sep 14, 2024

In terms of naming conventions, we have a couple of (semi-)relevant precedents:

  • @stdlib/constants/float64/precision: no indication that it refers to the number of bits.
  • @stdlib/constants/float64/num-bytes: uses the num- prefix to indicate that it refers to a quantity.

When I first saw high-word-significand-bits, I initially thought it was a high word mask. Only upon reading the code did I recognize that this referred to the number of bits in the significand.

My personal preference would be to rename the package and constant name to make its intent more obvious. Potential names:

  • @stdlib/constants/float64/num-high-word-significand-bits
  • @stdlib/constants/float64/high-word-precision

I think my preference is the first option, but I am open to suggestions.

@kgryte kgryte added the Needs Discussion Needs further discussion. label Sep 14, 2024
@gunjjoshi
Copy link
Member Author

@kgryte Thanks for explaining. That definitely makes sense.

num-high-word-significand-bits seems good, but could be quite long for a normal user. But, if that is not a major problem, I'll update this everywhere in this PR.

@kgryte
Copy link
Member

kgryte commented Sep 14, 2024

This pkg will be used rarely enough that length is not a huge concern. You may need to disable the ESLint rule for id-length each time the constant variable is declared in JS.

@gunjjoshi gunjjoshi changed the title feat: add constants/float64/high-word-significand-bits feat: add constants/float64/num-high-word-significand-bits Sep 15, 2024
@kgryte kgryte removed the Needs Discussion Needs further discussion. label Sep 16, 2024
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks, @gunjjoshi!

@kgryte kgryte merged commit 51787c8 into stdlib-js:develop Sep 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants