mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
LibCrypto+LibJS: Remove the create_from methods from BigInteger
Instead we just use a specific constructor. With this set of constructors using curly braces for constructing is highly recommended. As then it will not do too many implicit conversions which could lead to unexpected loss of data or calling the much slower double constructor. Also to ensure we don't feed (Un)SignedBigInteger infinities we throw RangeError earlier for Durations.
This commit is contained in:
parent
528891bf69
commit
791855deab
19 changed files with 77 additions and 82 deletions
|
@ -1082,7 +1082,7 @@ Crypto::SignedBigInteger round_number_to_increment(Crypto::SignedBigInteger cons
|
|||
if (increment == 1)
|
||||
return x;
|
||||
|
||||
auto increment_big_int = Crypto::UnsignedBigInteger::create_from(increment);
|
||||
auto increment_big_int = Crypto::UnsignedBigInteger { increment };
|
||||
|
||||
// 1. Let quotient be x / increment.
|
||||
auto division_result = x.divided_by(increment_big_int);
|
||||
|
@ -1137,7 +1137,7 @@ Crypto::SignedBigInteger round_number_to_increment_as_if_positive(Crypto::Signed
|
|||
if (increment == 1)
|
||||
return x;
|
||||
|
||||
auto increment_big_int = Crypto::UnsignedBigInteger::create_from(increment);
|
||||
auto increment_big_int = Crypto::UnsignedBigInteger { increment };
|
||||
|
||||
// 1. Let quotient be x / increment.
|
||||
auto division_result = x.divided_by(increment_big_int);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue