Affects Version/s: 1.0-pr
Fix Version/s: 1.0-pr
NumberType would be less confusing if it just stated the distinction whether a number has a fractional part.
A NumberType of INTEGER would guarantee that calling getBigIntegerValue does not throw an ArithmeticException. The NumberType would be independent of the actual magnitude of the number, thus calling getIntValueExact might still throw an Exception if the number is smaller than Integer.MIN_VALUE of larger than Integer.MAX_VALUE.
The current NumberType BIG_DECIMAL should be renamed to just DECIMAL or REAL (see http://en.wikipedia.org/wiki/Real_number) and would indicate that the number has a fractional part and calling get(Int|Long|BigInteger)ValueExact might throw an ArithmeticException.
The algorithm for distinguishing these two types should be based on whether BigDecimal#scale() is 0.