[TASK] Add a constant for the maximum number representable as a Ripple value.

This commit is contained in:
Stefan Thomas
2014-09-04 09:27:36 -07:00
parent 934cacfc1b
commit a3668defa8
3 changed files with 15 additions and 1 deletions

View File

@@ -33,6 +33,10 @@ var consts = exports.consts = {
cMinOffset: -96,
cMaxOffset: 80,
// Maximum possible amount for non-XRP currencies using the maximum mantissa
// with maximum exponent. Corresponds to hex 0xEC6386F26FC0FFFF.
max_value: '9999999999999999e80'
};

View File

@@ -345,7 +345,7 @@ var STAmount = exports.Amount = new SerializedType({
// Next eight bits: offset/exponent
hi |= ((97 + amount._offset) & 0xff) << 22;
// Remaining 52 bits: mantissa
// Remaining 54 bits: mantissa
hi |= amount._value.shiftRight(32).intValue() & 0x3fffff;
lo = amount._value.intValue() & 0xffffffff;
}