Package adams.core
Class IEEE754
- java.lang.Object
-
- adams.core.IEEE754
-
public class IEEE754 extends Object
Helper class for dealing with ieee754 encoded floats.- Version:
- $Revision$
- Author:
- dale
-
-
Constructor Summary
Constructors Constructor Description IEEE754()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
floatToIntBitsLittleEndian(Float f)
static int
longToIntBits(long l)
Convert long to int bitwise.static double
toDouble(double i)
Convert ieee754 int to double.static double[]
toDoubleArray(double[] in)
Convert ieee754 array(as doubles) to double array.static long
toIntBits(double d)
Convert double to ieee754 as long.static double[]
toIntBitsArray(double[] in)
Convert double array to ieee754 array(as doubles) .
-
-
-
Method Detail
-
toDouble
public static double toDouble(double i)
Convert ieee754 int to double.- Parameters:
i
- ieee754 int- Returns:
- float
-
longToIntBits
public static int longToIntBits(long l)
Convert long to int bitwise.- Parameters:
l
- long- Returns:
- int
-
toIntBits
public static long toIntBits(double d)
Convert double to ieee754 as long.- Parameters:
d
- double- Returns:
- ieee754
-
floatToIntBitsLittleEndian
public static byte[] floatToIntBitsLittleEndian(Float f)
-
toDoubleArray
public static double[] toDoubleArray(double[] in)
Convert ieee754 array(as doubles) to double array.- Parameters:
in
- ieee754 array(as doubles)- Returns:
- double array
-
toIntBitsArray
public static double[] toIntBitsArray(double[] in)
Convert double array to ieee754 array(as doubles) .- Parameters:
in
- double array- Returns:
- double array
-
-