I believe this result is incorrect and the library should return true in this case.
From my research, the maxDoubleQuantity is narrowed to a BigInteger. The DefaultNumberSystem assumes that a long value can be retrieved from a BigInteger to construct a BigDecimal for comparison. BigInteger returns the lower 64 bits upon conversion to a long value which results in a value of 0, instead an equivalent representation of Double.MAX_VALUE.
I worked around this issue by changing the consumer to define their maximum value as Long.MAX_VALUE. I am working on a pull request to fix the above issue.
I have discovered a case where Quantity of 42.42 is not considered less than a Quantity of Double.MAX_VALUE.
I believe this result is incorrect and the library should return true in this case.
From my research, the
maxDoubleQuantity
is narrowed to a BigInteger. TheDefaultNumberSystem
assumes that a long value can be retrieved from a BigInteger to construct a BigDecimal for comparison. BigInteger returns the lower 64 bits upon conversion to a long value which results in a value of0
, instead an equivalent representation ofDouble.MAX_VALUE
.I worked around this issue by changing the consumer to define their maximum value as
Long.MAX_VALUE
. I am working on a pull request to fix the above issue.