X_NEW_FLOAT_EXT format
aposto opened this issue · comments
Hee Yeon Cho commented
// 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