java/proto/src/main/java/com/pravala/protocol/FloatingPointUtils.java
public static long pack754 ( Double value )
    {
        if ( value == null || value == 0.0 )
        {
            return 0;
        }
        else if ( value == Double.NaN )
        {
            return SET_Q_NAN_64;
        }
        else if ( value == Double.POSITIVE_INFINITY )
        {
            return P_INF_64;
        }
        else if ( value == Double.NEGATIVE_INFINITY )
        {
            return N_INF_64;
        }
        else
        {
            return int_pack754 ( value, FL_BITS_64, FL_EXPBITS_64 );
        }
    }
/**
     * Packs a double value into long according to IEEE 754.
     * It handles special values (zero, NaN, and +/- infinity)
     * @param value The float value to pack.
     * @return Long representation of the float.
     */
Packs a double value into long according to IEEE 754.
It handles special values (zero, NaN, and +/- infinity)
@param value The float value to pack.
@return Long representation of the float.
Packs a double value into long according to IEEE 754 . It handles special values ( zero NaN and + / - infinity ) @param value The float value to pack . @return Long representation of the float .
public static long pack754 ( Double value )
    {
        if ( value == null || value == 0.0 )
        {
            return 0;
        }
        else if ( value == Double.NaN )
        {
            return SET_Q_NAN_64;
        }
        else if ( value == Double.POSITIVE_INFINITY )
        {
            return P_INF_64;
        }
        else if ( value == Double.NEGATIVE_INFINITY )
        {
            return N_INF_64;
        }
        else
        {
            return int_pack754 ( value, FL_BITS_64, FL_EXPBITS_64 );
        }
    }
public static long pack754 ( Double value ) { if ( value == null || value == 0.0 ) { return 0 ; } else if ( value == Double . NaN ) { return SET_Q_NAN_64 ; } else if ( value == Double . POSITIVE_INFINITY ) { return P_INF_64 ; } else if ( value == Double . NEGATIVE_INFINITY ) { return N_INF_64 ; } else { return int_pack754 ( value , FL_BITS_64 , FL_EXPBITS_64 ) ; } }
Packs a double value into long according to IEEE 754.
Packs a double value into long according to IEEE 754 .