Run the following snippets. They all produce different overflow handling one of
them seems wrong to me.
1000 ** 1000 ** 1000 --> java.lang.ArithmeticException: Exponent out of range
1000.0 ** 1000.0 ** 1000.0 --> Infinity or NaN depending on JVM version I think
1000.0 ** 1000 ** 1000 --> java.lang.NumberFormatException
1000.0 ** 1000.0 ** 1000.1 --> java.lang.NumberFormatException
This last two seem to be wrong. I am fairly certain this is due to the fact
that BigDecimal does not support infinity or NaN and non-integral so the ORC
implementation hacks it by converting to Double for fractional powers so an NaN
can be generated and then result in an error next time it interacts with a
BigDecimal.
Fixing this problem specifically is kind of a stop gap because Bug #18 is a
super set of this problem. However a quick fix to make it throw a more
reasonable exception seems like it would be useful.
Original issue reported on code.google.com by arthur.peters on 4 Sep 2012 at 9:23
Original issue reported on code.google.com by
arthur.peters
on 4 Sep 2012 at 9:23