n1analytics / javallier

A Java library for Paillier partially homomorphic encryption.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add methods to check the properties of a Number

mpnd opened this issue · comments

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.

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 invalid Long.
  • isFiniteDouble() all Double representations of reals except infinity are finite. Same for Number.

How about: decodesExactlyToLong(), decodesExactlyToDouble(), ...

commented

Number class has been removed in 84b894a.