-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
LibCrypto: Improve precision of BigFraction::to_double #3174
base: master
Are you sure you want to change the base?
Conversation
918decc
to
8882a9c
Compare
Improves coverage for Temporal::Duration when running test262. Two 262 Temporal tests from @trflynn89's list still fail:
Out of the failing tests, 1 in 3, resp. 1 in 4 conditions fail. Maybe a rounding issue? I looked briefly at the I am reasonably confident in the solution:
...but hey, I've been wrong before 😃 @trflynn89: I could totally benefit from a second pair of eyes... |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
- Before: UnsignedBigInteger::shift_right( n ) trigger index verification error for n>31. An assumption of num_bits<UnsignedBigInteger::BITS_IN_WORD was being made - After: shift_right( n ) works correctly for n>31.
Before: - a separate Word element allocation of the underlying Vector<Word> was necessary for every new word in a multi-word shift - two additional temporary UnsignedBigInteger buffers were allocated and passed through, including in downstream calls (e.g. Multiplication) - an additional allocation and word shift for the carry - FIXME note seems to point to some of these issues After: - main change is in LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp - one single allocation per call, using shift_left_by_n_words - only the input "number" and "output" need to be allocated by the caller - downstream calls are adapted not to allocate or pass temporary buffers - noticeable performance improvement when running TestBigInteger: from 41-42s (before) to 28-29s (after) on Intel Core i9 laptop NOTE: making this change in a separate commit than shift_right, even if it is in the same file BitwiseOperations.cpp since: - it is a "bonus" addition: not necessary for fixing the bug, but logically related to the shift_right code - it brings a chain of downstream interface modifications (7 files), unrelated to shift_right
Before: - FIXME: very naive implementation - was preventing passing some Temporal tests - https://github.com/tc39/test262 - https://github.com/LadybirdBrowser/libjs-test262
These were likely cut-and-paste artifacts from UnsignedBigInteger::multiplied_by; not caught by the "unused-varible". NOTE: making this change in a separate commit than shift_left, since it is logically unrelated.
Fixes #2639