Package com.io7m.junsigned.core
Class UnsignedDouble
java.lang.Object
com.io7m.junsigned.core.UnsignedDouble
Functions to convert unsigned integer values to/from values of
double.-
Method Summary
Modifier and TypeMethodDescriptionstatic doublefromUnsignedInt(int x) static doublefromUnsignedLong(long x) static doublemodulo(double x, double y) Calculate the unsigned modulox % y.static inttoUnsignedInt(double f) static longtoUnsignedLong(double f)
-
Method Details
-
fromUnsignedInt
public static double fromUnsignedInt(int x) - Parameters:
x- An unsigned integer value- Returns:
- The given unsigned integer value as a
double
-
toUnsignedInt
public static int toUnsignedInt(double f) - Parameters:
f- A floating point value- Returns:
- The given floating point value as an
int
-
fromUnsignedLong
public static double fromUnsignedLong(long x) - Parameters:
x- An unsigned integer value- Returns:
- The given unsigned integer value as a
double
-
toUnsignedLong
public static long toUnsignedLong(double f) - Parameters:
f- A floating point value- Returns:
- The given floating point value as a
long
-
modulo
Calculate the unsigned modulox % y.- Parameters:
x- The dividendy- The divisor- Returns:
- The unsigned modulo
x % y - Throws:
ArithmeticException- Iffy < 0
-