mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(big): add SBigIsOne
This commit is contained in:
parent
9074869097
commit
c9826d2336
5 changed files with 29 additions and 0 deletions
|
|
@ -220,6 +220,11 @@ int32_t IsOdd(const BigBuffer &num) {
|
|||
return num.Count() != 0 && (num[0] & 1) != 0;
|
||||
}
|
||||
|
||||
int32_t IsOne(const BigBuffer &num) {
|
||||
num.Trim();
|
||||
return num.Count() == 1 && num[0] == 1;
|
||||
}
|
||||
|
||||
uint64_t MakeLarge(uint32_t low, uint32_t high) {
|
||||
return low + (static_cast<uint64_t>(high) << 32);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue