Comments (4)
This function is definitively correct, at least in principle. I use it all over the place.
You can test it out in Python...
value = 0
s = "1X345678"
for i in range(len(s)):
value <<= 8
value += ord(s[len(s)-1-i])
print(hex(value))
val = value - 0x3030303030303030
det = ((value + 0x4646464646464646) | val) & 0x8080808080808080
print(det)
from fastdoubleparser.
I tried with all char values from [0, 65535] and it only matched the characters ['0','9'].
Can you provide an invalid input, that this method accepts?
from fastdoubleparser.
Ups, I tried with FastDoubleParser.parseDouble(String) which does not use this method.
Trying again and reporting back here.
from fastdoubleparser.
Ups, sorry... I missed that value
and val
have different values.
from fastdoubleparser.
Related Issues (20)
- FastDoubleParser doesn't support all input formats as the default OpenJDK Float/Double parsers HOT 10
- The parser throws StringIndexOutOfBoundsException/ArrayIndexOutOfBoundsException for some inputs HOT 6
- BigDecimal parser HOT 12
- Publish a multi-release JAR HOT 2
- Parsing of hexadecimal floating point numbers is broken in release 0.5.0 HOT 1
- Publish 0.5.2 to maven central HOT 2
- BigInteger parser HOT 6
- possible performance issue with very big doubles HOT 25
- Builds should be reproducible HOT 1
- Is this a mistake with hex float parsing? HOT 1
- Incorrect maven command sequence HOT 6
- Please bundle LICENSE/NOTICE files in the produced jar files HOT 49
- Implement faster slow path for double parser (JDK 21)
- Document which code signing keys will be used for published artifacts. HOT 2
- issue with module-info classes in v0.9.0 release HOT 3
- More efficient character group check HOT 1
- Bug: the highest bit of hexadecimal float significand ignored HOT 1
- Parser accepts invalid hex chars HOT 2
- NPE in "FastDoubleParser", method "JavaBigDecimalParser.parseBigDecimal()" HOT 1
- 1.0.0 release only supports very recent JVMs HOT 4
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 fastdoubleparser.