libbert icon indicating copy to clipboard operation
libbert copied to clipboard

X_NEW_FLOAT_EXT format

Open aposto opened this issue 14 years ago • 0 comments


// format.hpp 
#ifndef LIBBERT_NO_EXTENSION
  template < typename Iterator >
  Iterator format_new_float( real_t data, Iterator i ) {
    *i = (byte_t)X_NEW_FLOAT_EXT;
    char buf[8];
    std::copy( reinterpret_cast(&data), reinterpret_cast(&data)+8, buf );
#ifndef LIBBERT_BIGENDIAN
    std::reverse(buf, buf+8);
#endif
    return std::copy( buf, buf+8, i );
  }
#endif


aposto avatar Apr 06 '11 01:04 aposto