Bug in Number or BigInteger and BigDecimal (or alternatively in the API documentation of those)?
问题 According to the specification of Number.longValue() the method should... Returns the value of the specified number as a long. This may involve rounding or truncation. However, the BigInteger (and BigDecimal ) overrides this method and returns the 64 low bits of the integer part of the number it represents. From the docs of BigInteger for example: [...]if this BigInteger is too big to fit in a long, only the low-order 64 bits are returned.[...] I claim that either " This may involve rounding