Package io.keikai.doc.collab.lib0
Class Number
java.lang.Object
io.keikai.doc.collab.lib0.Number
Number Utility
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final longstatic final intstatic final longstatic final long -
Method Summary
-
Field Details
-
MAX_SAFE_INTEGER
public static final long MAX_SAFE_INTEGER- See Also:
-
MIN_SAFE_INTEGER
public static final long MIN_SAFE_INTEGER- See Also:
-
LOWEST_INT31
public static final int LOWEST_INT31- See Also:
-
HIGHEST_INT31
public static final int HIGHEST_INT31- See Also:
-
HIGHEST_UINT32
public static final long HIGHEST_UINT32- See Also:
-
-
Method Details
-
isInteger
public static boolean isInteger(double num) Checks if a number is an integer.- Parameters:
num- The number to check.- Returns:
- True if the number is an integer, false otherwise.
-
isNaN
public static boolean isNaN(double num) Checks if a value is NaN.- Parameters:
num- The value to check.- Returns:
- True if the value is NaN, false otherwise.
-
parseInt
Parses a string into an integer.- Parameters:
str- The string to parse.radix- The radix to use (e.g., 10 for decimal, 16 for hexadecimal).- Returns:
- The parsed integer.
-
countBits
public static int countBits(int n) Counts the number of "1" bits in an unsigned 32-bit number. This uses Brian Kernighan's algorithm.- Parameters:
n- The number to count bits in.- Returns:
- The number of "1" bits.
-