Giter Club home page Giter Club logo

Comments (6)

dsieger avatar dsieger commented on June 12, 2024

Not sure about this one. Seems more like a historical artifact due to the systems of that time being big endian. From the Geomview page:

This is the native format for 'int's and 'float's on Sun-3's, Sun-4's, and Irises, among others.

I'm not even sure if correct endianness conversion is feasible for floats, see also the Boost.Endian FAQ. Looks like simply swapping bytes around is not sufficient.

from pmp-library.

mmuman avatar mmuman commented on June 12, 2024

Well it's not like big-endian systems completely disappeared anyway, POWER9 can handle both, so using native-endian for a binary on-disk format is really a bad idea.

from pmp-library.

kintel avatar kintel commented on June 12, 2024

While naive byte swapping may not work well, there are other ways of performing floating point binary I/O, e.g. https://github.com/MalcolmMcLean/ieee754

from pmp-library.

kintel avatar kintel commented on June 12, 2024

After writing the above I was thinking about how protobuf does binary float encoding, and it looks like they just assume the same endinaness as int32_t and use that to write little endian binaries: https://github.com/protocolbuffers/protobuf/blob/5d876c9fec1a6f2feb0750694f803f89312bffff/src/google/protobuf/wire_format_lite.h#L827

from pmp-library.

dsieger avatar dsieger commented on June 12, 2024

I agree it would be nice to make this consistent with the spec. I'll give it a shot, not sure when I'll find time though.

from pmp-library.

dsieger avatar dsieger commented on June 12, 2024

Our CI is not yet ready for some C++23 functionality I was using to implement this.

from pmp-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.