src/lib/serial.c
void serial_float64(uint8_t * * const ptr, const float64_t v)
{
    if (bigendian()) {
        memcpy(*ptr, &v, sizeof(float64_t));
    } else {
        int i;
        uint8_t rv[sizeof(float64_t)];
        uint8_t *pv = (uint8_t *) &v;

        for (i = 0; i < 8; i++) {
            rv[i] = pv[7 - i];
        }
        memcpy(*ptr, &rv, sizeof(float64_t));
    }
    *ptr += sizeof(float64_t);
}
/*  serial_float64  --  Serialise a 64 bit IEEE floating point number.
                        This code assumes that the host floating point
                        format is IEEE and that floating point quantities
                        are stored in IEEE format either LSB first or MSB
                        first.  More creative host formats will require
                        additional transformations here.  */
serial_float64  --  Serialise a 64 bit IEEE floating point number.
This code assumes that the host floating point
format is IEEE and that floating point quantities
are stored in IEEE format either LSB first or MSB
first.  More creative host formats will require
additional transformations here.
serial_float64 -- Serialise a 64 bit IEEE floating point number . This code assumes that the host floating point format is IEEE and that floating point quantities are stored in IEEE format either LSB first or MSB first . More creative host formats will require additional transformations here .
void serial_float64(uint8_t * * const ptr, const float64_t v)
{
    if (bigendian()) {
        memcpy(*ptr, &v, sizeof(float64_t));
    } else {
        int i;
        uint8_t rv[sizeof(float64_t)];
        uint8_t *pv = (uint8_t *) &v;
        for (i = 0; i < 8; i++) {
            rv[i] = pv[7 - i];
        }
        memcpy(*ptr, &rv, sizeof(float64_t));
    }
    *ptr += sizeof(float64_t);
}
void serial_float64 ( uint8_t * * const ptr , const float64_t v ) { if ( bigendian ( ) ) { memcpy ( * ptr , & v , sizeof ( float64_t ) ) ; } else { int i ; uint8_t rv [ sizeof ( float64_t ) ] ; uint8_t * pv = ( uint8_t * ) & v ; for ( i = 0 ; i < 8 ; i ++ ) { rv [ i ] = pv [ 7 - i ] ; } memcpy ( * ptr , & rv , sizeof ( float64_t ) ) ; } * ptr += sizeof ( float64_t ) ; }
serial_float64  --  Serialise a 64 bit IEEE floating point number.
serial_float64 -- Serialise a 64 bit IEEE floating point number .