mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(big): add SBigDec
This commit is contained in:
parent
5e776b6db7
commit
fac094793a
6 changed files with 97 additions and 50 deletions
|
|
@ -392,7 +392,20 @@ void Sub(BigBuffer& a, const BigBuffer& b, const BigBuffer& c) {
|
|||
}
|
||||
|
||||
a.SetCount(i);
|
||||
// This assert does not exist in retail WoW or Starcraft.
|
||||
//STORM_ASSERT(!borrow);
|
||||
}
|
||||
|
||||
void Sub(BigBuffer& a, const BigBuffer& b, uint32_t c) {
|
||||
uint64_t borrow = 0;
|
||||
|
||||
uint32_t i = 0;
|
||||
for (; b.IsUsed(i); i++) {
|
||||
borrow += b[i] - static_cast<uint64_t>(c);;
|
||||
a[i] = ExtractLowPartSx(borrow);
|
||||
}
|
||||
|
||||
a.SetCount(i);
|
||||
// This assert does not exist in retail WoW or Starcraft.
|
||||
//STORM_ASSERT(!borrow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ void Square(BigBuffer& a, const BigBuffer& b, BigStack& stack);
|
|||
|
||||
void Sub(BigBuffer& a, const BigBuffer& b, const BigBuffer& c);
|
||||
|
||||
void Sub(BigBuffer& a, const BigBuffer& b, uint32_t c);
|
||||
|
||||
void ToBinary(TSGrowableArray<uint8_t>& output, const BigBuffer& buffer);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue