LibCrypto: Add naive implementation of {Un,}SignedBigInteger::to_double

This commit is contained in:
Idan Horowitz
2021-09-06 21:20:20 +03:00
committed by Linus Groh
parent 62bc238ac3
commit bcdad57670
Notes: sideshowbarker 2024-07-18 04:34:19 +09:00
4 changed files with 16 additions and 0 deletions

View File

@@ -112,6 +112,12 @@ u64 UnsignedBigInteger::to_u64() const
return value;
}
double UnsignedBigInteger::to_double() const
{
// FIXME: I am naive
return static_cast<double>(to_u64());
}
void UnsignedBigInteger::set_to_0()
{
m_words.clear_with_capacity();