266 Commits

Author SHA1 Message Date
IRainman
eef7133edc Merge branch 'main' of https://github.com/fastfloat/fast_float 2026-07-05 20:14:17 +03:00
sahvx655-wq
c539b5399c guard is_space against negative signed code units 2026-06-18 19:51:56 +05:30
Daniel Lemire
fd970ab05e updating visual studio 2026-06-13 21:41:53 -04:00
Daniel Lemire
a7249f86ed replace checked re-parse with O(1) simdjson-style overflow check
The previous commit detects multi-wrap u64 overflow at the max_digits
boundary by re-parsing the digits through a checked multiply-add loop
(O(max_digits)). Replace that with the constant-time check used in
simdjson: the leading digit plus a single threshold comparison.

For a max_digits-length value, min_safe_u64(base) == base^(max_digits-1)
is the smallest such value and also the width of each leading-digit band
[d*ms, (d+1)*ms). Since that width is < 2^64, the only band that can
straddle 2^64 is d == dmax (the largest leading digit that still fits),
and there it straddles at most once, so a single threshold dmax*ms
separates wrapped from non-wrapped values. A leading digit above dmax
always overflows; below dmax always fits. dmax and the threshold derive
from the existing min_safe_u64 table, so no new tables are needed and
dmax*ms cannot itself overflow.

Add a programmatic, self-verifying test for parse_int_string overflow
detection covering bases 2..36, complementing the hand-picked strings
added earlier. Every generated input is cross-checked against an
independent trusted oracle (a plain 64-bit checked multiply-add); on
success the parsed value is also compared exactly and full consumption
of the input is asserted.

Per base it exercises:
  - an exact-boundary sweep of the 64 values straddling 2^64
    (UINT64_MAX-31 .. 2^64+31), built by walking the digit string;
  - UINT64_MAX, 2^64 and the all-max-digit value, each also with
    leading zeros;
  - random max_digits-length values across every leading digit, with
    the heaviest sampling on the lead == dmax band that straddles 2^64,
    and full coverage of lead > dmax (the multi-wrap region the naive
    min_safe check accepted by mistake);
  - max_digits-1 (never overflows) and max_digits+1 (always overflows).
A small signed (int64_t) section checks the exact INT64_MIN/INT64_MAX
limits round-trip and that INT64_MAX+1 / INT64_MIN-1 are rejected in
every base.
2026-06-13 21:34:34 -04:00
sahvx655-wq
632cc97b5b detect uint64 overflow that wraps past min_safe in parse_int_string 2026-06-13 21:21:29 -04:00
Daniel Lemire
8234a89623 8.2.9 2026-06-11 20:29:24 -04:00
sahvx655-wq
82882b237d gate uint8/uint16 base-10 fast paths to single-byte code units 2026-06-10 12:12:34 +05:30
Daniel Lemire
937198691a
Merge pull request #389 from correctmost/cm/remove-unreachable-return
Remove an unreachable return statement
2026-06-09 11:18:15 -04:00
correctmost
6ae691372f Remove an else if statement that is always false
Commit b334317d added the same std::isnan(v) check as an earlier
condition.

The warning was reported by cppcheck.
2026-06-09 03:48:54 -04:00
correctmost
8fe7a9405b Remove an unreachable return statement
The redundant statement was reported by cppcheck.
2026-06-09 03:37:58 -04:00
fcostaoliveira
b642d9202f tests: parallelize exhaustive32 and exhaustive32_64 sweeps too
Same std::thread split as exhaustive32_midpoint; preserves each test's existing
failure behavior (abort for exhaustive32, stop-flag for exhaustive32_64).
2026-06-01 21:09:46 +01:00
fcostaoliveira
b20c420964 tests: parallelize the exhaustive midpoint sweep across hardware threads 2026-06-01 13:01:10 +01:00
IRainman
1d3332ec2d Merge branch 'main' of https://github.com/fastfloat/fast_float 2026-03-26 20:18:17 +03:00
Daniel Lemire
50c19fad17 init 2026-03-10 11:53:45 -04:00
HedgehogInTheCPP
a2774ae899
Merge branch 'fastfloat:main' into main 2026-03-05 00:40:59 +03:00
재욱
3e2b5d3dc3 refactor verification calls for double and float limits 2026-02-04 15:36:31 +09:00
재욱
f43d6711bc Add additional verification cases for double and float limits 2026-02-04 15:27:46 +09:00
IRainman
b6db81d8b4 unfck lint 2026-01-21 03:55:27 +03:00
IRainman
4a0bd5e9ea unfck lint 2026-01-21 03:36:32 +03:00
IRainman
6d6acd4364 update for copy-pasted tests. meh. needs cleanup. 2026-01-21 03:31:04 +03:00
IRainman
a9d84bbcb2 style cleanup. 2026-01-21 03:14:46 +03:00
IRainman
306f7ea4f3 fix for old C++ standard in test. 2026-01-21 02:38:13 +03:00
IRainman
060c33175d include fix. 2026-01-21 02:32:16 +03:00
IRainman
58bfb0375d cleanup test for the best compilation and more aggressive optimization to test errors in the code. 2026-01-20 23:44:34 +03:00
IRainman
24231804ec cleanup 2025-12-29 23:49:30 +03:00
IRainman
8f795017cb * small cleanup in the tests/basictest.cpp 2025-12-29 21:51:47 +03:00
IRainman
59c873d028 cleanup. 2025-12-28 16:43:33 +03:00
IRainman
0d36a018ef Doctest DOCTEST_CONFIG_SUPER_FAST_ASSERTS 2025-12-26 00:49:05 +03:00
IRainman
350ad6ecac unfck lint 2025-12-26 00:22:44 +03:00
IRainman
cdabfe49af # constexpr noexcept 2025-12-25 23:00:52 +03:00
IRainman
be4683501e fix for biodegradable code in doctest. 2025-12-25 19:37:41 +03:00
IRainman
325c7236e7 MSVC compilation fix. 2025-12-25 19:16:26 +03:00
IRainman
7041f91d47 Merge branch 'main' of https://github.com/fastfloat/fast_float 2025-12-25 11:33:24 +03:00
Shikhar
97cb3ec28d lint
Signed-off-by: Shikhar <shikharish05@gmail.com>
2025-12-25 03:06:22 +05:30
Daniel Lemire
120bdfd713 adding some ipv4 test 2025-12-24 15:43:43 -05:00
IRainman
ac1e4dd805 Merge branch 'main' of https://github.com/fastfloat/fast_float 2025-12-24 22:15:34 +03:00
Daniel Lemire
6b72e26ba7 documenting better which types we support 2025-12-15 10:28:06 -05:00
IRainman
597c239218 # test fixed. 2025-11-10 03:13:05 +03:00
IRainman
b8163709f5 * type usage fix for better performance in any hardware. 2025-11-10 02:41:26 +03:00
IRainman
c8e4d89fef # unfck lint 2025-11-09 18:15:53 +03:00
IRainman
959c9531ea # cycles (for and while) cleanup in low level for the best compiler optimization and the best runtime. 2025-11-09 18:13:17 +03:00
IRainman
50fa3ad99e * code cleanup. 2025-11-09 16:34:42 +03:00
IRainman
9e1d063628 # tests 2025-11-09 00:12:43 +03:00
IRainman
77ef46838c * try to fix precision error on x86 platform step3. 2025-11-08 19:40:24 +03:00
IRainman
fe0bce5eb7 # const and constexpr fixes
# types fixes.
# FASTFLOAT_ASSERT fix.
2025-10-21 21:08:08 +03:00
IRainman
031f7febbe # tests are updated 2025-10-21 19:31:28 +03:00
IRainman
0f1a96a389 Merge branch 'main' of https://github.com/fastfloat/fast_float 2025-10-21 15:43:38 +03:00
Pavel Novikov
88f6c5e367
Added corner cases around max value/infinity 2025-10-04 14:39:00 +03:00
Pavel Novikov
e9438e64ba
fixed copy&paste error and minor mess 2025-09-29 19:54:25 +03:00
Pavel Novikov
7abb574ffc
added doc to README and examples 2025-09-29 13:00:40 +03:00