Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X_NEW_FLOAT_EXT format #2

Open
aposto opened this issue Apr 6, 2011 · 0 comments
Open

X_NEW_FLOAT_EXT format #2

aposto opened this issue Apr 6, 2011 · 0 comments

Comments

@aposto
Copy link

aposto commented Apr 6, 2011


// 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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant