public final class UnsignedUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.graalvm.word.UnsignedWord |
MAX_VALUE
The UnsignedWord of the greatest magnitude.
|
| Modifier and Type | Method and Description |
|---|---|
static org.graalvm.word.UnsignedWord |
clamp(org.graalvm.word.UnsignedWord value,
org.graalvm.word.UnsignedWord min,
org.graalvm.word.UnsignedWord max) |
static org.graalvm.word.UnsignedWord |
fromDouble(double d) |
static boolean |
isAMultiple(org.graalvm.word.UnsignedWord that,
org.graalvm.word.UnsignedWord multiple)
Check that an Unsigned is an even multiple.
|
static org.graalvm.word.UnsignedWord |
max(org.graalvm.word.UnsignedWord x,
org.graalvm.word.UnsignedWord y)
The maximum of two Unsigneds.
|
static org.graalvm.word.UnsignedWord |
min(org.graalvm.word.UnsignedWord x,
org.graalvm.word.UnsignedWord y)
The minimum of two Unsigneds.
|
static org.graalvm.word.UnsignedWord |
roundDown(org.graalvm.word.UnsignedWord that,
org.graalvm.word.UnsignedWord multiple)
Round an Unsigned down to the nearest smaller multiple.
|
static org.graalvm.word.UnsignedWord |
roundUp(org.graalvm.word.UnsignedWord that,
org.graalvm.word.UnsignedWord multiple)
Round an Unsigned up to the nearest larger multiple.
|
static int |
safeToInt(org.graalvm.word.UnsignedWord w)
Converts an
UnsignedWord to a positive signed int, asserting that it can be
correctly represented. |
static double |
toDouble(org.graalvm.word.UnsignedWord u) |
public static final org.graalvm.word.UnsignedWord MAX_VALUE
public static org.graalvm.word.UnsignedWord roundDown(org.graalvm.word.UnsignedWord that,
org.graalvm.word.UnsignedWord multiple)
that - The Unsigned to be rounded down.multiple - The multiple to which that Unsigned should be decreased.public static org.graalvm.word.UnsignedWord roundUp(org.graalvm.word.UnsignedWord that,
org.graalvm.word.UnsignedWord multiple)
that - The Unsigned to be rounded up.multiple - The multiple to which that Unsigned should be increased.public static boolean isAMultiple(org.graalvm.word.UnsignedWord that,
org.graalvm.word.UnsignedWord multiple)
that - The Unsigned to be verified as a multiple.multiple - The multiple against which the Unsigned should be verified.public static org.graalvm.word.UnsignedWord min(org.graalvm.word.UnsignedWord x,
org.graalvm.word.UnsignedWord y)
x - An Unsigned.y - Another Unsigned.public static org.graalvm.word.UnsignedWord max(org.graalvm.word.UnsignedWord x,
org.graalvm.word.UnsignedWord y)
x - An Unsigned.y - Another Unsigned.public static int safeToInt(org.graalvm.word.UnsignedWord w)
UnsignedWord to a positive signed int, asserting that it can be
correctly represented.public static org.graalvm.word.UnsignedWord clamp(org.graalvm.word.UnsignedWord value,
org.graalvm.word.UnsignedWord min,
org.graalvm.word.UnsignedWord max)
public static double toDouble(org.graalvm.word.UnsignedWord u)
public static org.graalvm.word.UnsignedWord fromDouble(double d)