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

Not working for big endian (typedarray) #98

Open
trosos opened this issue Nov 23, 2022 · 1 comment · May be fixed by #103
Open

Not working for big endian (typedarray) #98

trosos opened this issue Nov 23, 2022 · 1 comment · May be fixed by #103

Comments

@trosos
Copy link

trosos commented Nov 23, 2022

The machinery with __kBitConversionBuffer is tied to little endian systems.
On big endian systems, the two slots on __kBitConversionInts are swapped.

To illustrate, consider

JSBI.LT(JSBI.BigInt("4294967296"), 4294967296);

On big endian environments, the above expression evaluates to true, which is wrong.
(In this specific example, the execution path starts to diverge here.)

Perhaps the most prominent example of big-endian environment is that emulated by typedarray.

Thank you for the library.

@jakobkummerow
Copy link
Collaborator

Sorry that it took a while to get to this. Can you confirm that #103 fixes the issue? I don't have a big endian machine to test it on myself.

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 a pull request may close this issue.

2 participants