Package convex.core.util
Class UMath
java.lang.Object
convex.core.util.UMath
Functions for unsigned maths.
It would be nice if Java included these by default.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longmultiplyHigh(long a, long b)Gets the high 64 bits of an unsigned multiplystatic longunsignedAddCarry(long a, long b)Gets the carry of an unsigned addition of two longs
-
Constructor Details
-
UMath
public UMath()
-
-
Method Details
-
multiplyHigh
public static long multiplyHigh(long a, long b)Gets the high 64 bits of an unsigned multiply- Parameters:
a- 64-bit long interpreted as unsigned valueb- 64-bit long interpreted as unsigned value- Returns:
- High 64 bits of unsigned multiply
-
unsignedAddCarry
public static long unsignedAddCarry(long a, long b)Gets the carry of an unsigned addition of two longs- Parameters:
a- 64-bit long interpreted as unsigned valueb- 64-bit long interpreted as unsigned value- Returns:
- 1 if the addition carries, 0 otherwise
-