java.lang.Object
com.github.stephengold.joltjni.std.Std
Java equivalents for (and access to) certain features of the
std::
namespace.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrintStreamstandard error stream (to expedite translation of C++ code)static final PrintStreamstandard output stream (to expedite translation of C++ code)static final Stringline separator (to expedite translation of C++ code)static final floatdifference between 1 and the smallest float greater than 1static final floatlargest finite value of typefloatstatic final intlargest value of typeint -
Method Summary
Modifier and TypeMethodDescriptionstatic floatexp(float value) Return the exponential of the specified single-precision value.static floatfmod(float numerator, float denominator) Return the remainder whennumeratoris divided bydenominator.static floathypot(float opposite, float adjacent) Return the hypotenuse of the specified right triangle.static floatpow(float base, float exponent) Return the specified power of the specified single-precision base.static voidshuffle(int[] indices, DefaultRandomEngine generator) Shuffle the specified array.static voidshuffle(List<Object> list, DefaultRandomEngine generator) Shuffle the specified Java list.static intCount the number of elements in the specified array.static floatsqrt(float value) Return the square root of the specified single-precision value.static intCompare the specified strings lexicographically.
-
Field Details
-
FLT_EPSILON
public static final float FLT_EPSILONdifference between 1 and the smallest float greater than 1- See Also:
-
FLT_MAX
public static final float FLT_MAXlargest finite value of typefloat- See Also:
-
INT_MAX
public static final int INT_MAXlargest value of typeint- See Also:
-
cerr
standard error stream (to expedite translation of C++ code) -
cout
standard output stream (to expedite translation of C++ code) -
endl
line separator (to expedite translation of C++ code)
-
-
Method Details
-
exp
public static float exp(float value) Return the exponential of the specified single-precision value. There's evidence this is faster thanMath.exp(double).- Parameters:
value- the input exponent- Returns:
- the exponential
-
fmod
public static float fmod(float numerator, float denominator) Return the remainder whennumeratoris divided bydenominator.- Parameters:
numerator- the numeratordenominator- the denominator- Returns:
- the remainder (with the same sign as
numerator)
-
hypot
public static float hypot(float opposite, float adjacent) Return the hypotenuse of the specified right triangle.- Parameters:
opposite- the signed length of the opposite sideadjacent- the signed length of the adjacent side- Returns:
- the length of the hypotenuse (≥0)
-
pow
public static float pow(float base, float exponent) Return the specified power of the specified single-precision base. There's evidence this is faster thanMath.pow(double, double).- Parameters:
base- the base valueexponent- the exponent value- Returns:
- the power value
-
shuffle
Shuffle the specified array.- Parameters:
indices- the values to shuffle (not null, modified)generator- the sequence generator to use (not null, modified)
-
shuffle
Shuffle the specified Java list.- Parameters:
list- the list to shuffle (not null, modified)generator- the sequence generator to use (not null, modified)
-
size
Count the number of elements in the specified array.- Parameters:
array- the array to measure (not null, unaffected)- Returns:
- the number of elements (≥0)
-
sqrt
public static float sqrt(float value) Return the square root of the specified single-precision value. There's evidence this is slower thanMath.sqrt(double).- Parameters:
value- the input value- Returns:
- the square root
-
strcmp
Compare the specified strings lexicographically.- Parameters:
lhs- the first string to compare (not null)rhs- the 2nd string to compare (not null)- Returns:
- a negative value if
lhsprecedesrhsin lexicographical order, or greater than zero iflhsfollowsrhs, or zero if they are equal
-