Git Product home page Git Product logo

Comments (9)

Shnatsel avatar Shnatsel commented on August 18, 2024 1

I see, thanks for clarification.

Parsing numbers with leading zeroes is something people also need to do, and I think this library could do it faster than str::strip_leading_maches('0'). There are ways to quickly count leading decimal zeroes with SIMD: KholdStare/qnd-integer-parsing-experiments#2

from atoi_simd.

Shnatsel avatar Shnatsel commented on August 18, 2024

Actually, it fails with SIMD enabled as well. So turning SIMD on/off doesn't make any difference.

from atoi_simd.

Shnatsel avatar Shnatsel commented on August 18, 2024

I am also getting a similar error when trying to parse 0000000000000000000000000000000000000001

The standard library implementation also handles this one correctly.

from atoi_simd.

RoDmitry avatar RoDmitry commented on August 18, 2024

Zeroes at the beginning of the input are not supported by the design, and I am not sure if it's needed, because it will work slower.

from atoi_simd.

RoDmitry avatar RoDmitry commented on August 18, 2024

Hm, it might be not that slow as I thought. Will think about it, thanks

from atoi_simd.

RoDmitry avatar RoDmitry commented on August 18, 2024

It works, but with length not more then type's numbers max length 2288368 (starting with 16)

from atoi_simd.

Shnatsel avatar Shnatsel commented on August 18, 2024

FWIW the standard library parser supports even longer sequences of leading zeroes, so that 000000000000000001 does parse correctly into a u16.

It's up to you whether you choose to support this use case.

from atoi_simd.

RoDmitry avatar RoDmitry commented on August 18, 2024

I just don't see any use cases. If anybody needs it, write it here, with an explanation of the use case, would be interesting to know.

from atoi_simd.

RoDmitry avatar RoDmitry commented on August 18, 2024

Done in a separate function atoi_simd::parse_skipped

from atoi_simd.

Related Issues (7)

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.