Comments (9)
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.
Actually, it fails with SIMD enabled as well. So turning SIMD on/off doesn't make any difference.
from atoi_simd.
I am also getting a similar error when trying to parse 0000000000000000000000000000000000000001
The standard library implementation also handles this one correctly.
from atoi_simd.
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.
Hm, it might be not that slow as I thought. Will think about it, thanks
from atoi_simd.
It works, but with length not more then type's numbers max length 2288368 (starting with 16)
from atoi_simd.
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.
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.
Done in a separate function atoi_simd::parse_skipped
from atoi_simd.
Related Issues (7)
- Out-of-bounds Read HOT 44
- Parsing numbers starting with `+` is not supported HOT 4
- Parsing very large `i32` and `u32` returns an incorrect number instead of an error HOT 6
- Parsing `i128` and `u128` may cause integer overflow when AVX is used
- Some `u128` and `i128` values are parsed incorrectly instead of returning an error HOT 3
- parse_skipped can't parse zeros
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atoi_simd.