Skip to content

Conversation

bptato
Copy link
Contributor

@bptato bptato commented Sep 28, 2025

It's more compact than xsum.

Copy link
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

Nice!

a = float64_as_uint64(d);
sgn = a >> 63;
e = (a >> 52) & ((1 << 11) - 1);
m = a & (((uint64_t)1 << 52) - 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a little more legible as:

Suggested change
m = a & (((uint64_t)1 << 52) - 1);
m = a & ((1ULL << 52) - 1);

Although I can't fault you for being precise with types. Consider it just a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the rest of the code uses the uint64_t pattern too, so I think it's better to stick to it.

Copy link
Contributor

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Cool!

@bnoordhuis bnoordhuis merged commit a13b04f into quickjs-ng:master Sep 29, 2025
127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants