Giter Site home page Giter Site logo

Comments (6)

frink avatar frink commented on May 11, 2024

Could we copy an existing implementation from one of the many libs around?
Or would it be better to simplify for our single use case?

from facil.io.

boazsegev avatar boazsegev commented on May 11, 2024

@frink ,

You're probably right. Finding a good implementation with an MIT license and integrating it is would probably be the most effective approach - especially if we could use the makefile script to install it directly from the original repo.

However, there's a couple of reasons I'm holding off on that:

  1. I want to support binary representation, (0b01...), parsing doubles using their binary IEEE 754 representation. The fio_atol adds support for binary numbers and I thought fio_atof should follow suite.

  2. I love to understand the code that I use, just so I can better maintain the project. That's why I prefer (when possible) to give it a try myself and solve what I can before integrating someone else's code / approach.

Having said that, adding a task to the makefile, like the one for BearSSL, would be a great solution.

from facil.io.

frink avatar frink commented on May 11, 2024

Musl is MIT. Don't know if it supports binary representations or not...

This one is public domain but may need a little finesse:
https://gist.github.com/mattn/1890186

from facil.io.

boazsegev avatar boazsegev commented on May 11, 2024

Thanks for taking the time to find a solution.

Lets put this one on low priority, there's a bunch of stuff that uses strtod and not all systems have issues in their implementations.

I think BearSSL would be more important than this side-detail.

Also...

Musl (edit: the public domain version in the link) suffers from more rounding errors my current version suffers from (my current, un-uploaded version, has 52bit precision on the mantissa instead of 53 bit precision, which is my only issue).

In addition, Musl (edit: the public domain version in the link) doesn't support hex notation, NaN and Infinity... which I think could be important (my version also supports binary notation, but I didn't finish the hex notation yet).

from facil.io.

boazsegev avatar boazsegev commented on May 11, 2024

Correction: I was looking at the public domain implementation. The Musl library might be a good option for an strtod patch. I'll review it later.

from facil.io.

frink avatar frink commented on May 11, 2024

Good dea!

from facil.io.

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.