mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibJS: Add a js_bigint(VM&, ...) overload and use it
We already have js_string(VM&, ...) and js_symbol(VM&, ...) overloads, so feels very familiar.
This commit is contained in:
parent
dc9f516339
commit
f58891ed42
8 changed files with 67 additions and 50 deletions
|
@ -61,7 +61,7 @@ BigInt* get_epoch_from_iso_parts(GlobalObject& global_object, i32 year, u8 month
|
|||
VERIFY(ms.is_finite_number());
|
||||
|
||||
// 8. Return ℝ(ms) × 10^6 + microsecond × 10^3 + nanosecond.
|
||||
return js_bigint(vm.heap(), Crypto::SignedBigInteger::create_from(static_cast<i64>(ms.as_double())).multiplied_by(Crypto::UnsignedBigInteger { 1'000'000 }).plus(Crypto::SignedBigInteger::create_from((i64)microsecond * 1000)).plus(Crypto::SignedBigInteger(nanosecond)));
|
||||
return js_bigint(vm, Crypto::SignedBigInteger::create_from(static_cast<i64>(ms.as_double())).multiplied_by(Crypto::UnsignedBigInteger { 1'000'000 }).plus(Crypto::SignedBigInteger::create_from((i64)microsecond * 1000)).plus(Crypto::SignedBigInteger(nanosecond)));
|
||||
}
|
||||
|
||||
// -864 * 10^19 - 864 * 10^14
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue