1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:17:34 +00:00

LibJS: Add all of the DataView.prototype.set* methods

This commit is contained in:
Idan Horowitz 2021-06-14 02:02:53 +03:00 committed by Linus Groh
parent c54b9a6920
commit d7a70eb77c
8 changed files with 203 additions and 0 deletions

View file

@ -102,6 +102,17 @@ String UnsignedBigInteger::to_base10() const
return builder.to_string();
}
u64 UnsignedBigInteger::to_u64() const
{
VERIFY(sizeof(Word) == 4);
if (!length())
return 0;
u64 value = m_words[0];
if (length() > 1)
value |= static_cast<u64>(m_words[1]) << 32;
return value;
}
void UnsignedBigInteger::set_to_0()
{
m_words.clear_with_capacity();