Skip to content

Commit

Permalink
shortcut to avoid fmod
Browse files Browse the repository at this point in the history
  • Loading branch information
gf2121 committed Jan 3, 2021
1 parent e26c9bb commit 658494b
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -751,6 +751,12 @@ Number valueForSearch(Number value) {
* Returns true if the object is a number and has a decimal part
*/
public static boolean hasDecimalPart(Object number) {
if (number instanceof Byte
|| number instanceof Short
|| number instanceof Integer
|| number instanceof Long) {
return false;
}
if (number instanceof Number) {
double doubleValue = ((Number) number).doubleValue();
return doubleValue % 1 != 0;
Expand Down

0 comments on commit 658494b

Please sign in to comment.