1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-16 18:32:06 +00:00
serenity/Userland/Libraries/LibCrypto/BigInt
davidot 8b8cee3172 LibCrypto: Implement a (mostly) proper to_double for UnsignedBigInteger
SignedBigInteger can immediately use this by just negating the double if
the sign bit is set.
For simple cases (below 2^53) we can just convert via an u64, however
above that we need to extract the top 53 bits and use those as the
mantissa.

This function currently does not behave exactly as the JS spec specifies
however it is much less naive than the previous implementation.
2022-08-24 23:27:17 +01:00
..
Algorithms Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
SignedBigInteger.cpp LibCrypto: Implement a (mostly) proper to_double for UnsignedBigInteger 2022-08-24 23:27:17 +01:00
SignedBigInteger.h LibCrypto: Add a way to compare a SignedBigInteger with a double 2022-08-24 23:27:17 +01:00
UnsignedBigInteger.cpp LibCrypto: Implement a (mostly) proper to_double for UnsignedBigInteger 2022-08-24 23:27:17 +01:00
UnsignedBigInteger.h LibCrypto: Add the [[nodiscard]] qualifier in both BigInteger classes 2022-07-09 15:55:32 +00:00