mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Step 1: Convert Number to use 128-bit numbers internally
- Update the conversion points between Number and *Amount & STNumber. - Tests probably don't pass.
This commit is contained in:
@@ -50,8 +50,11 @@ STNumber::add(Serializer& s) const
|
||||
XRPL_ASSERT(
|
||||
getFName().fieldType == getSType(),
|
||||
"ripple::STNumber::add : field type match");
|
||||
s.add64(value_.mantissa());
|
||||
s.add32(value_.exponent());
|
||||
constexpr std::int64_t min = 100'000'000'000'000'000LL;
|
||||
constexpr std::int64_t max = min * 10 - 1;
|
||||
auto const [mantissa, exponent] = value_.normalizeToRange(min, max);
|
||||
s.add64(mantissa);
|
||||
s.add32(exponent);
|
||||
}
|
||||
|
||||
Number const&
|
||||
|
||||
Reference in New Issue
Block a user