Giter VIP home page Giter VIP logo

Comments (8)

bast avatar bast commented on August 15, 2024

I will test this and once we have more data we can think about what we do with it.

from parselglossy.

bast avatar bast commented on August 15, 2024

After a bit of reading (in particular https://docs.python.org/3/library/json.html#implementation-limitations), we can expect the serialized data to contain the same range and precision as the Python data types. But whether we lose the range and precision depends on who is reading the JSON.

If Python, my guess is that there is no significant loss. But with other JSON implementations, I guess it depends.

from parselglossy.

bast avatar bast commented on August 15, 2024

I also tested this locally Python -> JSON -> Python. But I haven't tested reading into another language with another implementation.

from parselglossy.

robertodr avatar robertodr commented on August 15, 2024

@stigrj can you run some tests in cpp-parselglossy? We need to check this also for the Fortran and C examples. If those JSON libraries do not present this problem, then I think we can document our preference for the JSON libraries for compiled languages and warning people about this possible pitfall with libraries we have not personally tested.

On a different note, I've never set a floating point parameter in an input file that employed the full range and precision... Any other input parser would hit the same problem, I think.

from parselglossy.

bast avatar bast commented on August 15, 2024

I also think that this is not a JSON-specific problem but basically a problem of reading a number from file. We should check how C and Fortran read floats, testing both range and precision.

from parselglossy.

robertodr avatar robertodr commented on August 15, 2024

from parselglossy.

bast avatar bast commented on August 15, 2024

Where will we document our findings? On the lib side or the tutorial side?

from parselglossy.

robertodr avatar robertodr commented on August 15, 2024

A mention on both sides seems the safest bet.

from parselglossy.

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.