Dmitri Blinov created JEXL-167:
----------------------------------
Summary: Possible loss of value when converting BigDecimal to
BigInteger
Key: JEXL-167
URL: https://issues.apache.org/jira/browse/JEXL-167
Project: Commons JEXL
Issue Type: Bug
Affects Versions: 3.0
Reporter: Dmitri Blinov
In JexlArithmetic.java method *public BigInteger toBigInteger(Object val)* uses
the following case for BigDecimals as for any other numbers:
...
else if (val instanceof Number) {
return BigInteger.valueOf(((Number) val).longValue());
...
For large BigDecimals > Long.MAX_VALUE it may lead to loss of value. Please
consider using BigDecimal.toBigInteger() method for that case?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)