219 Commits

Author SHA1 Message Date
IRainman
df6b574e40 * try to fix precision error on x86 platform step6. 2025-11-08 21:38:15 +03:00
IRainman
cd62aadb1b * try to fix precision error on x86 platform step5. 2025-11-08 21:26:31 +03:00
IRainman
578b1e9898 * try to fix precision error on x86 platform step4. 2025-11-08 21:19:23 +03:00
IRainman
77ef46838c * try to fix precision error on x86 platform step3. 2025-11-08 19:40:24 +03:00
IRainman
e96afe608e * try to fix precision error on x86 platform step2. 2025-11-08 19:25:53 +03:00
IRainman
eee068d3bc # types fix. 2025-10-21 22:19:04 +03:00
IRainman
336b97d027 # cleanup. 2025-10-21 22:01:22 +03:00
IRainman
fe0bce5eb7 # const and constexpr fixes
# types fixes.
# FASTFLOAT_ASSERT fix.
2025-10-21 21:08:08 +03:00
IRainman
0f1a96a389 Merge branch 'main' of https://github.com/fastfloat/fast_float 2025-10-21 15:43:38 +03:00
Daniel Lemire
7262d9454e lint 2025-09-29 15:08:24 -04:00
Daniel Lemire
fd98fd6689
specialize for std::float32_t and std::float64_t explicitly
credit: @lemire
2025-09-29 21:43:36 +03:00
Pavel Novikov
197c0ffca7
clang format 2025-09-29 21:43:35 +03:00
IRainman
af8ece24d7 Merge branch 'main' of https://github.com/fastfloat/fast_float 2025-09-18 22:10:37 +03:00
Daniel Lemire
88b1e5321c version 8.1.0 2025-09-18 09:38:45 -06:00
Daniel Lemire
0b6d911220 format 2025-09-18 08:30:28 -06:00
Daniel Lemire
bb956b29db release candidate 8.0.3 2025-09-18 07:44:53 -06:00
Daniel Lemire
48fc5404d4 compatibility fix 2025-09-18 07:44:05 -06:00
IRainman
10970dbbae # cleanup 2025-09-17 00:52:26 +03:00
IRainman
af1f8e3ac2 Merge branch 'main' of https://github.com/fastfloat/fast_float 2025-09-16 00:58:58 +03:00
InvalidUsernameException
9d81c71aef Do not mis-parse certain wide-character emojis as integer
When calling ch_to_digit() with a UTF-16 or UTF-32 code unit, it simply
truncates away any data stored in the non-low byte(s) of the code unit.
It then uses a lookup table to determine whether the low byte
corresponds to an ASCII digit. This is incorrect because as soon as any
bit outside the low byte is set, the number will never correspond to a
ASCII digit anymore.

To fix this, we produce a mask that is all zeroes if any bit outside the
low byte is set in the code unit, all ones otherwise. Anding this mask
with the original code unit forces the table lookup to return the
sentinel value from the zero-index if any high bit was set and causes
the code unit not to be parsed as integer.

This bug was discovered when loading Mastodon posts inside the Ladybird
browser where some of Mastodon's JavaScript would trigger the code path
that erroneously parsed the emoji as integer. It had the visible effect
that some digits inside the posts would get rendered as one of the
emojis that parsed to that digit. For more details see this issue:
https://github.com/LadybirdBrowser/ladybird/issues/6205

The emojis in the test case are simply all the emojis used on Mastodon
that caused the bug. They can be found here:
06803422da/app/javascript/mastodon/features/emoji/emoji_map.json
2025-09-15 23:12:28 +02:00
WenLei
6677924083 float_common.h: Support RISC-V 2025-09-11 11:11:30 +08:00
Daniel Lemire
81b8306c5f implementation of https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2497r0.html 2025-05-19 18:08:36 -04:00
IRainman
978441a5bb additional FASTFLOAT_HAS_BIT_CAST improve for older standards. 2025-05-07 23:19:18 +03:00
IRainman
a550415314 additional fix for bfloat16_t. Sorry, I can't compile it's locally. 2025-05-07 22:55:48 +03:00
IRainman
4b94a612cf type usage fix 2025-05-07 00:44:20 +03:00
IRainman
2f8ff9a6eb compilation fix 2025-05-06 23:40:29 +03:00
IRainman
3f9e488979 format, fuck. 2025-05-06 21:09:33 +03:00
IRainman
e5f189754f compilation fixes. 2025-05-06 21:05:05 +03:00
IRainman
99d769db5b clang-format 2025-05-06 18:15:43 +03:00
IRainman
d5c05e51af additional type usage fixes and constexpr. 2025-05-06 17:44:31 +03:00
IRainman
afbb803aa4 compilation fixes for std::bfloat16_t and std::float16_t. Sorry for this, my compilers don't supports it.
additional type usage fixes and constexpr.
2025-05-06 16:53:30 +03:00
IRainman
1febc3a070 Fix compilation for older standards 2025-05-05 20:19:46 +03:00
IRainman
0ba4e20bc4 lint 2025-05-05 19:49:53 +03:00
IRainman
5356317356 Fix compilation for older standards 2025-05-05 19:44:30 +03:00
IRainman
103f22056b Final functions call optimization. 2025-05-05 19:07:55 +03:00
IRainman
8721491941 Finally: after type refactoring is done give compiler opportunity to select best type for performance. 2025-05-05 18:42:32 +03:00
IRainman
17ffdffdd9 * additional types cleanup for speedup and reduce cache pressure. 2025-04-12 19:16:25 +03:00
IRainman
0a18d6b329 # format. 2025-04-12 17:17:04 +03:00
IRainman
ba1344c030 * carefully work with types in the library.
* fix for some types errors.
* fix small amount of not optimized code.
* add more comments to the code.
* unified of function binary_format::max_mantissa_fast_path() because it's do the same.
2025-04-12 17:06:38 +03:00
IRainman
69fbbff062 try additional part... 2025-04-12 00:47:18 +03:00
IRainman
b0bae17b10 * added chars_format_t for performance reason. 2025-04-11 23:49:27 +03:00
IRainman
0daee75dec # format 2025-04-11 22:56:15 +03:00
IRainman
e71bfff4a3 additional improve for debug runtime. 2025-04-11 18:05:08 +03:00
IRainman
f8625b6416 fix warnings. 2025-04-10 18:45:05 +03:00
IRainman
8e1fda5d08 fixes and cleanup for the parse_number_string function.
exponent value is always less than in16_t.

original main:
Tests:
 time is: 44278ms.

size of my tests 389.0k
size of my program 164.0k

my main:
Tests:
 time is: 42015ms.

size of my tests 389.0k
size of my program 164.0k

my main with FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
Tests:
 time is: 41282ms.

size of my tests 386.5k
size of my program 161.5k

After this I'll try it on my partner Linux machine with the original tests and compare much better.
2025-04-10 17:18:08 +03:00
IRainman
c762936589 template interface cleanup for min_safe_u64 and max_digits_u64. 2025-04-09 15:55:54 +03:00
IRainman
a081ebe6ce reduce size of from_chars_result_t to 4 bytes. Cleanup for usage FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN. 2025-04-09 15:27:55 +03:00
IRainman
f1b7f493aa after all sized checks is done I return the minimum registers size possible for the counter. Because the library only support 32 and 64 bit platform we only need 32 bit as a small counter. 2025-04-08 18:43:12 +03:00
IRainman
a133b72fa8 FASTFLOAT_ASSUME 2025-04-08 03:24:11 +03:00
IRainman
b261492ae7 reduce register pressure. 2025-04-08 01:22:14 +03:00