Package com.scriptbasic.utility
Class NumberUtility
java.lang.Object
com.scriptbasic.utility.NumberUtility
public class NumberUtility
extends java.lang.Object
Utility class to compare Number variables, Long or Double.
- Author:
- Peter Verhas date Jul 21, 2012
-
Method Summary
Modifier and Type Method Description static intcompare(java.lang.Number a, java.lang.Number b)Compares the numbers a and b.static booleanisPositive(java.lang.Number a)
-
Method Details
-
isPositive
public static boolean isPositive(java.lang.Number a) -
compare
public static int compare(java.lang.Number a, java.lang.Number b)Compares the numbers a and b.- Parameters:
a- one of the numbersb- the other number- Returns:
- 0 if a == b; 1 if a > b; and -1 if b < a
-