Package adams.core

Class IEEE754


  • public class IEEE754
    extends Object
    Helper class for dealing with ieee754 encoded floats.
    Version:
    $Revision$
    Author:
    dale
    • Constructor Detail

      • IEEE754

        public IEEE754()
    • 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