public final class MathUtils extends Object
Constructor and Description |
---|
MathUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
bitVector2ByteVector(int bitVector,
int length)
Convert an integer containing length bits into a vector of bytes.
|
static double |
exp2(double val)
exp2.
|
static byte[] |
Float2IBM(double fVal)
Converts a double to the standard IBM representation for a single precision real floating point number.
|
static byte |
frexpExp(double val)
frexpExp, builds and gives the exponent base 2 for the floating point representation of a real number.
|
static double |
frexpMant(double val)
frexpMant, builds and gives the mantissa base 2 for the floating point representation of a real number.
|
static double |
IBM2FLoat(int a,
int b,
int c,
int d)
Convert four bytes into a float value.
|
static int |
int2(int a,
int b)
Convert two bytes into a signed integer.
|
static int |
int3(int a,
int b,
int c)
Convert three bytes into a signed integer.
|
static int |
int4(int a,
int b,
int c,
int d)
Convert four bytes into a signed integer.
|
static double |
log2(double val)
log2.
|
static byte[] |
signedInt2Bytes(int val,
int numBytes)
signedInt2Bytes, converts a signed integer to a vector of bytes.
|
static int |
uint2(int a,
int b)
Convert two bytes into an unsigned integer.
|
static int |
uint3(int a,
int b,
int c)
Convert three bytes into an unsigned integer.
|
public static int int2(int a, int b)
a
- higher byteb
- lower bytepublic static int int3(int a, int b, int c)
a
- higher byteb
- middle part bytec
- lower bytepublic static int int4(int a, int b, int c, int d)
a
- highest byteb
- higher middle bytec
- lower middle byted
- lowest bytepublic static int uint2(int a, int b)
a
- higher byteb
- lower bytepublic static int uint3(int a, int b, int c)
a
- higher byteb
- middle bytec
- lower bytepublic static double IBM2FLoat(int a, int b, int c, int d)
a
- highest byteb
- higher bytec
- lower byted
- lowest bytepublic static byte[] Float2IBM(double fVal)
public static byte[] bitVector2ByteVector(int bitVector, int length)
bitVector
- int The bit vector to convert.length
- int The number of bits in the vector.public static double log2(double val)
aFloat
- floatpublic static double exp2(double val)
val
- doublepublic static byte[] signedInt2Bytes(int val, int numBytes)
public static double frexpMant(double val)
public static byte frexpExp(double val)
Copyright © 2006–2019 GeoSolutions. All rights reserved.