Giter Site home page Giter Site logo

Comments (5)

ibireme avatar ibireme commented on September 18, 2024 1

Done: 6d41604

from yyjson.

ibireme avatar ibireme commented on September 18, 2024

No, yyjson writes floating point numbers using the Schubfach algorithm, which converts floating point numbers to the shortest possible decimal representation.

from yyjson.

wang21825227 avatar wang21825227 commented on September 18, 2024

Will you consider supporting setting this writing parameter later?

from yyjson.

ibireme avatar ibireme commented on September 18, 2024

I'll consider supporting it in the future, but it's not a high priority at the moment.

Implementing this feature would require rewriting the internal float-point writing algorithm, which could be complex and may affect performance.

from yyjson.

jagoly avatar jagoly commented on September 18, 2024

A potentially simpler feature that I would like is the ability to write out numbers as if they were 32 bit floats. In my project (a game), all of my real numbers are 32 bit. I've got an editor that can edit things and write out json, but converting values from floats to doubles results in nice short values like 0.8 instead being written out as 0.800000011920929.

from yyjson.

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.