mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
LibJS: Fix modulo in get_iso_parts_from_epoch() for negative epoch ns
This now matches the spec change from reminder() to modulo which was
done here: bdf60f5
This commit is contained in:
parent
61410e05eb
commit
c56e5139f5
2 changed files with 7 additions and 1 deletions
|
@ -121,7 +121,7 @@ ISODateTime get_iso_parts_from_epoch(BigInt const& epoch_nanoseconds)
|
|||
// 1. Assert: epochNanoseconds is an integer.
|
||||
|
||||
// 2. Let remainderNs be epochNanoseconds modulo 10^6.
|
||||
auto remainder_ns_bigint = epoch_nanoseconds.big_integer().divided_by(Crypto::UnsignedBigInteger { 1'000'000 }).remainder;
|
||||
auto remainder_ns_bigint = modulo(epoch_nanoseconds.big_integer(), Crypto::UnsignedBigInteger { 1'000'000 });
|
||||
auto remainder_ns = remainder_ns_bigint.to_double();
|
||||
|
||||
// 3. Let epochMilliseconds be (epochNanoseconds − remainderNs) / 10^6.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue