Add methods to check the properties of a Number
mpnd opened this issue · comments
mpnd commented
Having some methods to check the properties of a Number
could be useful. For example, isValidLong()
to check whether a number can be converted to a valid long or isFiniteDouble
to check whether a number can be converted to a finite double.
Wilko Henecka commented
If I understand correctly, you want some methods to test if a Number
can be decoded exactly as a Long
or Double
.
I don't like the suggested names:
isValidLong()
implies that there are invalidLong
.isFiniteDouble()
allDouble
representations of reals except infinity are finite. Same forNumber
.
How about: decodesExactlyToLong()
, decodesExactlyToDouble()
, ...