Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
336 commits
Select commit Hold shift + click to select a range
a4d1174
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Apr 10, 2025
e71bfff
additional improve for debug runtime.
IRainman Apr 11, 2025
88b3887
benchmark cleanup.
IRainman Apr 11, 2025
563648f
* fix errors in the parse_number_string.
IRainman Apr 11, 2025
0daee75
# format
IRainman Apr 11, 2025
1aed8ee
try reordering again.
IRainman Apr 11, 2025
f3db77a
try reordering again.
IRainman Apr 11, 2025
b0bae17
* added chars_format_t for performance reason.
IRainman Apr 11, 2025
69fbbff
try additional part...
IRainman Apr 11, 2025
ba1344c
* carefully work with types in the library.
IRainman Apr 12, 2025
0a18d6b
# format.
IRainman Apr 12, 2025
17ffdff
* additional types cleanup for speedup and reduce cache pressure.
IRainman Apr 12, 2025
c99930b
added additional macro FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED for…
IRainman Apr 29, 2025
7bd3c54
benchmarks are updated.
IRainman Apr 29, 2025
4e230e8
benchmarks are updated.
IRainman Apr 29, 2025
d67876e
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Apr 29, 2025
58cb366
Finally: after type refactoring is done give compiler opportunity to …
IRainman May 5, 2025
8721491
Finally: after type refactoring is done give compiler opportunity to …
IRainman May 5, 2025
8ccb587
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman May 5, 2025
103f220
Final functions call optimization.
IRainman May 5, 2025
5356317
Fix compilation for older standards
IRainman May 5, 2025
0ba4e20
lint
IRainman May 5, 2025
1febc3a
Fix compilation for older standards
IRainman May 5, 2025
a8c5bd9
warning fix.
IRainman May 5, 2025
9049a1a
clang-format.
IRainman May 6, 2025
c94d3a0
clang-format
IRainman May 6, 2025
b2ea7bc
clang-format
IRainman May 6, 2025
afbb803
compilation fixes for std::bfloat16_t and std::float16_t. Sorry for t…
IRainman May 6, 2025
d5c05e5
additional type usage fixes and constexpr.
IRainman May 6, 2025
99d769d
clang-format
IRainman May 6, 2025
66363cc
try to fix stupid shit in the tests, meh.
IRainman May 6, 2025
ba3f7a6
.
IRainman May 6, 2025
f2befa5
.
IRainman May 6, 2025
e5f1897
compilation fixes.
IRainman May 6, 2025
30bd959
Update msys2-clang.yml
IRainman May 6, 2025
c339618
Update msys2.yml
IRainman May 6, 2025
3f9e488
format, fuck.
IRainman May 6, 2025
a10b25f
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman May 6, 2025
a4c573e
compilation fix
IRainman May 6, 2025
a3ccc1f
compilation fix
IRainman May 6, 2025
e446899
compilation fix.
IRainman May 6, 2025
6f789de
compilation fix.
IRainman May 6, 2025
1ec5f08
compilation fix
IRainman May 6, 2025
036ba0d
compilation fix
IRainman May 6, 2025
568dfef
compilation fix
IRainman May 6, 2025
2f8ff9a
compilation fix
IRainman May 6, 2025
4b94a61
type usage fix
IRainman May 6, 2025
23a9c3f
review of the parse_number_string function: now it's much faster, saf…
IRainman May 7, 2025
f7d5037
fix for the parse_number_string
IRainman May 7, 2025
6b22957
fix for the parse_number_string
IRainman May 7, 2025
3ee80c2
fix for the parse_number_string
IRainman May 7, 2025
88fff01
fix for the parse_number_string
IRainman May 7, 2025
f14d482
fix for the parse_number_string
IRainman May 7, 2025
7bac324
fix for the parse_number_string
IRainman May 7, 2025
a550415
additional fix for bfloat16_t. Sorry, I can't compile it's locally.
IRainman May 7, 2025
978441a
additional FASTFLOAT_HAS_BIT_CAST improve for older standards.
IRainman May 7, 2025
437a80c
fix for type usage in parse_int_string
IRainman May 8, 2025
5ae2fba
cleanup for parse_number_string
IRainman May 10, 2025
4213171
compilation fix for internal tests
IRainman May 12, 2025
a72afb5
unfck clang format
IRainman May 12, 2025
acdcd04
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Jun 14, 2025
0cdbf36
Bump actions/checkout from 4 to 5 in the github-actions group
dependabot[bot] Aug 18, 2025
41dc71f
Merge branch 'fastfloat:main' into main
IRainman Aug 27, 2025
cd3118d
Merge pull request #2 from IRainman/dependabot/github_actions/github-…
IRainman Aug 27, 2025
af1f8e3
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Sep 15, 2025
e3aa994
# fix for stackvec constructor.
IRainman Sep 16, 2025
10970db
# cleanup
IRainman Sep 16, 2025
af8ece2
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Sep 18, 2025
3292820
* Readme updated.
IRainman Sep 18, 2025
097800a
# compilation fix after merge from upstream.
IRainman Sep 18, 2025
384fcec
# clang format
IRainman Sep 18, 2025
fe37628
# types fix after merge from upstream.
IRainman Sep 18, 2025
c7e0786
Update README.md
IRainman Sep 19, 2025
9f4be55
Bump the github-actions group across 1 directory with 3 updates
dependabot[bot] Oct 13, 2025
0f1a96a
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Oct 21, 2025
72e75ed
# compilation fix after merge.
IRainman Oct 21, 2025
240d393
# format
IRainman Oct 21, 2025
322e17b
Merge pull request #5 from IRainman/dependabot/github_actions/github-…
IRainman Oct 21, 2025
3288e56
# compilation fix after merge
IRainman Oct 21, 2025
4dcaf50
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Oct 21, 2025
031f7fe
# tests are updated
IRainman Oct 21, 2025
1dc13a9
# improve checking for integer in the FASTFLOAT_ONLY_POSITIVE_C_NUMBE…
IRainman Oct 21, 2025
fe0bce5
# const and constexpr fixes
IRainman Oct 21, 2025
5a378ed
# minimize diff in the crutch.
IRainman Oct 21, 2025
0e123c5
# fix for digit_comp.
IRainman Oct 21, 2025
487799e
# cleanup and speedup digit_comp.
IRainman Oct 21, 2025
336b97d
# cleanup.
IRainman Oct 21, 2025
eee068d
# types fix.
IRainman Oct 21, 2025
1f0e281
# type usage fix.
IRainman Oct 21, 2025
58b5dc0
* Upgrade manually vectorized code to SSE4.2 for FASTFLOAT_64BIT beca…
IRainman Oct 21, 2025
f757eb4
* Upgrade manually vectorized code to support SSE4.2.
IRainman Oct 21, 2025
f396c23
* Upgrade manually vectorized code to support SSE4.2, final cleanup a…
IRainman Oct 21, 2025
397c0b8
# fix for FASTFLOAT_64BIT
IRainman Oct 21, 2025
1dfd486
# cleanup
IRainman Oct 21, 2025
57f63fc
* fix for parse_eight_digits_unrolled
IRainman Oct 21, 2025
6c175c5
# format
IRainman Oct 21, 2025
0c4171e
# small cleanup
IRainman Oct 21, 2025
5dc09e7
Bump the github-actions group across 1 directory with 3 updates
dependabot[bot] Nov 3, 2025
1d912b7
Merge pull request #7 from IRainman/dependabot/github_actions/github-…
IRainman Nov 8, 2025
625d9af
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Nov 8, 2025
f5dbaab
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Nov 8, 2025
e35e6d2
Merge branch 'fastfloat:main' into main
IRainman Nov 8, 2025
97045b1
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Nov 8, 2025
56d4233
* Improving in code generation -> speedup.
IRainman Nov 8, 2025
62b60e0
# Disable FASTFLOAT_HAS_BYTESWAP: step to try to fix precision error …
IRainman Nov 8, 2025
e6f2bf1
# test failed.
IRainman Nov 8, 2025
e96afe6
* try to fix precision error on x86 platform step2.
IRainman Nov 8, 2025
77ef468
* try to fix precision error on x86 platform step3.
IRainman Nov 8, 2025
578b1e9
* try to fix precision error on x86 platform step4.
IRainman Nov 8, 2025
cd62aad
* try to fix precision error on x86 platform step5.
IRainman Nov 8, 2025
df6b574
* try to fix precision error on x86 platform step6.
IRainman Nov 8, 2025
1ba0d48
* try to fix precision error on x86 platform step7.
IRainman Nov 8, 2025
97aa629
* try to fix precision error on x86 platform step8.
IRainman Nov 8, 2025
3e498bb
* try to fix precision error on x86 platform step9.
IRainman Nov 8, 2025
a92f025
* type usage fix
IRainman Nov 8, 2025
9e1d063
# tests
IRainman Nov 8, 2025
80902aa
* try to fix error on x86 platform step1.
IRainman Nov 9, 2025
50fa3ad
* code cleanup.
IRainman Nov 9, 2025
d0c7def
* try to fix error on x86 platform step2.
IRainman Nov 9, 2025
3ae6d3c
# unfck lint
IRainman Nov 9, 2025
e109eed
* try to fix error on x86 platform step3.
IRainman Nov 9, 2025
b9d91e7
* code cleanup.
IRainman Nov 9, 2025
959c953
# cycles (for and while) cleanup in low level for the best compiler o…
IRainman Nov 9, 2025
c8e4d89
# unfck lint
IRainman Nov 9, 2025
497e65b
* Added separate config macros FASTFLOAT_ISNOT_CHECKED_BOUNDS.
IRainman Nov 9, 2025
b816370
* type usage fix for better performance in any hardware.
IRainman Nov 9, 2025
597c239
# test fixed.
IRainman Nov 10, 2025
c9d0ac0
# cleanup.
IRainman Nov 10, 2025
843aa3f
* improvements in compiler function detection.
IRainman Nov 12, 2025
3685667
* FASTFLOAT_HAS_BIT_CAST cleanup.
IRainman Nov 19, 2025
3d46d99
# warning fix.
IRainman Nov 21, 2025
d697541
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Dec 4, 2025
077c6d0
Bump the github-actions group across 1 directory with 2 updates
dependabot[bot] Dec 8, 2025
7fd3d71
Merge branch 'fastfloat:main' into main
IRainman Dec 8, 2025
1cc96de
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Dec 8, 2025
f4b821a
Merge pull request #9 from IRainman/dependabot/github_actions/github-…
IRainman Dec 8, 2025
588623e
* type usage fix for better performance in any hardware.
IRainman Dec 8, 2025
c54bafd
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Dec 8, 2025
b79c3e5
Benchmark are updated.
IRainman Dec 9, 2025
47e181d
Bump the github-actions group with 2 updates
dependabot[bot] Dec 15, 2025
ac1e4dd
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Dec 24, 2025
b73ae25
Merge pull request #10 from IRainman/dependabot/github_actions/github…
IRainman Dec 24, 2025
65810eb
* enable warning in GCC because PVS-Studio are also detect this. This…
IRainman Dec 24, 2025
0838651
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Dec 24, 2025
f42c880
* enable warning in GCC because PVS-Studio are also detect this. This…
IRainman Dec 24, 2025
600f236
* Small optimization in code generation for auto vectorization.
IRainman Dec 25, 2025
7041f91
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Dec 25, 2025
b7fb05b
* Added additional compile option FASTFLOAT_TABLE_HACK_CHAR_DIGIT_LUT…
IRainman Dec 25, 2025
2aba168
* optimize layout of the parsed_number_string_t.
IRainman Dec 25, 2025
a8c78f4
unfck lint.
IRainman Dec 25, 2025
e88d9ae
FASTFLOAT_HAS_BYTESWAP cleanup.
IRainman Dec 25, 2025
325c723
MSVC compilation fix.
IRainman Dec 25, 2025
9ff1624
small fix.
IRainman Dec 25, 2025
074fdea
small fix
IRainman Dec 25, 2025
be46835
fix for biodegradable code in doctest.
IRainman Dec 25, 2025
cdabfe4
# constexpr noexcept
IRainman Dec 25, 2025
d07362c
Final review for a more simple merge.
IRainman Dec 25, 2025
350ad6e
unfck lint
IRainman Dec 25, 2025
c119cdd
revert workflows.
IRainman Dec 25, 2025
0d36a01
Doctest DOCTEST_CONFIG_SUPER_FAST_ASSERTS
IRainman Dec 25, 2025
54d1f5a
fucking lint
IRainman Dec 25, 2025
5652a16
Update the Readme with fmt to the high performance example.
IRainman Dec 26, 2025
3ae10ee
Enhance README with compiler optimization details
IRainman Dec 26, 2025
8a518f4
am_pow_t is probably needs to be 64 bit because some hard coded value…
IRainman Dec 26, 2025
7ce5343
try again. need test refactoring.
IRainman Dec 26, 2025
6cefbb5
remove format.cmd: use IDE.
IRainman Dec 27, 2025
3745f4b
* documentation in the code updated, fixed errors with parsing some s…
IRainman Dec 27, 2025
2260580
fix compilation error in uint8_t parsing.
IRainman Dec 27, 2025
fb1e92c
code cleanup and type usage fixes.
IRainman Dec 27, 2025
812d89e
type usage fixes.
IRainman Dec 27, 2025
c1265cf
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Dec 28, 2025
62bc4b4
type usage fixes.
IRainman Dec 28, 2025
59c873d
cleanup.
IRainman Dec 28, 2025
5bc9637
type usage fixes.
IRainman Dec 28, 2025
5c6a6c2
type usage fixes.
IRainman Dec 28, 2025
8f49511
noexcept
IRainman Dec 28, 2025
489703f
type usage fixes.
IRainman Dec 28, 2025
37152ea
type usage fixes.
IRainman Dec 28, 2025
054004f
cleanup and type usage fixes.
IRainman Dec 28, 2025
ebc2ee8
optimization for the report_parse_error.
IRainman Dec 28, 2025
dad07cc
initialization cleanup and improve caches usage.
IRainman Dec 29, 2025
59da568
type usage fix.
IRainman Dec 29, 2025
5857b98
some warnings fix in CI builds.
IRainman Dec 29, 2025
a28e112
initialization cleanup.
IRainman Dec 29, 2025
38d0ab3
initialization cleanup.
IRainman Dec 29, 2025
147cf3b
type usage fix and cleanup.
IRainman Dec 29, 2025
351e4d3
type usage fixes.
IRainman Dec 29, 2025
35bca9c
type usage fixes.
IRainman Dec 29, 2025
0d42336
type usage fixes.
IRainman Dec 29, 2025
8330f85
type usage fixes.
IRainman Dec 29, 2025
611cd92
type usage fixes.
IRainman Dec 29, 2025
f4cae22
type usage fix.
IRainman Dec 29, 2025
9a0fa47
cleanup.
IRainman Dec 29, 2025
f556a68
cleanup.
IRainman Dec 29, 2025
41d9632
interface cleanup.
IRainman Dec 29, 2025
8f79501
* small cleanup in the tests/basictest.cpp
IRainman Dec 29, 2025
7ca9c84
type usage fixes.
IRainman Dec 29, 2025
f92d7fb
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Dec 29, 2025
2423180
cleanup
IRainman Dec 29, 2025
051d151
small performance improvement after full cleanup.
IRainman Dec 29, 2025
cd61547
FASTFLOAT_HAS_BIT_CAST fix for old standards.
IRainman Dec 29, 2025
fcdb586
cleanup in the API.
IRainman Dec 29, 2025
3d69a95
type usage fix.
IRainman Dec 29, 2025
f9bac93
type usage fix.
IRainman Dec 29, 2025
4910698
added compilation flags to the bench ip.
IRainman Dec 29, 2025
ba656ac
improvements in the code generation for byteswap and leading_zero to …
IRainman Dec 30, 2025
48abeeb
byteswap isn't compiling properly, no nay crutches that I try not hel…
IRainman Dec 30, 2025
61c7b53
small update for benchmark.
IRainman Dec 30, 2025
f5d44c7
compilation fix.
IRainman Dec 30, 2025
b28862b
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Jan 13, 2026
299c274
copy-past fix and type usage fixes.
IRainman Jan 13, 2026
21d4ce1
Fixes for FASTFLOAT_IS_BIG_ENDIAN after PR #359 is added to original.
IRainman Jan 13, 2026
c3a14e6
cleanup and fix for uint8_t and uint16_t parsing.
IRainman Jan 14, 2026
8ac483a
fix for integer_times_pow10.
IRainman Jan 14, 2026
5b1291b
Fix for parse_int_string, not all compilers work properly.
IRainman Jan 14, 2026
44606ae
nope, my implementation is fine. Needs compilers and tests check:
IRainman Jan 14, 2026
c4fc2ba
try to cleanup crutches: it's not needed anymore?
IRainman Jan 14, 2026
5e6dab2
workaround needs for both gcc and clang.
IRainman Jan 14, 2026
63b882e
fix for parse_int_string.
IRainman Jan 14, 2026
a8ef3f9
cleanup. all others bug in the compilers or in the workflows.
IRainman Jan 14, 2026
5631567
cleanup.
IRainman Jan 14, 2026
199c0fd
Update CI badge and add CodeFactor badge
IRainman Jan 20, 2026
fae37d7
Update README badges for Ubuntu 24.04
IRainman Jan 20, 2026
1f0c6c3
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Jan 20, 2026
e3cf45f
Merge branch 'main' of https://github.com/fastfloat/fast_float
IRainman Jan 20, 2026
4b6689b
Bump the github-actions group across 1 directory with 2 updates
dependabot[bot] Jan 20, 2026
44bb42b
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Jan 20, 2026
7ec5fc4
Cleanup after merge.
IRainman Jan 20, 2026
dc4e02e
unfck lint.
IRainman Jan 20, 2026
ce5ec31
Merge pull request #13 from IRainman/dependabot/github_actions/github…
IRainman Jan 20, 2026
0471b05
harder code optimization ;) also in the test that show the error.
IRainman Jan 20, 2026
654d721
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Jan 20, 2026
58bfb03
cleanup test for the best compilation and more aggressive optimizatio…
IRainman Jan 20, 2026
3b7dc1e
cleanup, unfortunately, the patch isn't correct. fastfloat_strncasecm…
IRainman Jan 20, 2026
f9e2220
review of the fastfloat_strncasecmp3 fastfloat_strncasecmp5 fastfloat…
IRainman Jan 20, 2026
856047b
gcc build fix
IRainman Jan 20, 2026
060c331
include fix.
IRainman Jan 20, 2026
155be7d
cleanup.
IRainman Jan 20, 2026
306f7ea
fix for old C++ standard in test.
IRainman Jan 20, 2026
7eab293
fix for old C++ standard in library.
IRainman Jan 20, 2026
52cd6d9
fix for old standard.
IRainman Jan 20, 2026
58b805d
Add CI badges for various platforms in README
IRainman Jan 20, 2026
2a092b4
fix for gcc.
IRainman Jan 20, 2026
89c69ca
Merge branch 'main' of https://github.com/IRainman/fast_float
IRainman Jan 20, 2026
a9d84bb
style cleanup.
IRainman Jan 21, 2026
6d6acd4
update for copy-pasted tests. meh. needs cleanup.
IRainman Jan 21, 2026
4a0bd5e
unfck lint
IRainman Jan 21, 2026
4ca0df8
isolate clang crutch.
IRainman Jan 21, 2026
b6db81d
unfck lint
IRainman Jan 21, 2026
c4a979f
tests cleanup
IRainman Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- riscv64
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v6.0.1

- name: Install latest Alpine Linux for ${{ matrix.arch }}
uses: jirutka/setup-alpine@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/amalgamate-ubuntu24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ubuntu-build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Compile with amalgamation
run: |
mkdir build &&
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v4.2.2
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
- uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
- name: Verify
run: emcc -v
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v3.6.0
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v3.6.0
- name: Configure
run: emcmake cmake -B build
- name: Build # We build but do not test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_and_format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v4.1.7
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.1.7

- name: Run clang-format
uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msys2-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
CMAKE_GENERATOR: Ninja

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- uses: msys2/setup-msys2@v2
with:
update: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
CMAKE_GENERATOR: Ninja

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- uses: msys2/setup-msys2@v2
with:
update: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1

- name: Amalgamate fast_float.h
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/risc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Install packages
run: |
sudo apt-get update -q -y
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/s390x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- uses: uraimo/run-on-arch-action@v3
name: Test
id: runcmd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu22-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ubuntu-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Install clang++-14
run: sudo apt-get install -y clang++-14
- name: Use cmake
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu22-gcc12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ubuntu-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Use cmake
run: |
mkdir build &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu22-sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ubuntu-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Use cmake
run: |
mkdir build &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ubuntu-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Use cmake
run: |
mkdir build &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu24-cxx20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Use cmake
run: |
mkdir build &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ubuntu-build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.1
- name: Use cmake
run: |
set -xe
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-arm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- {gen: Visual Studio 17 2022, arch: ARM64, cfg: Debug}
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v6.0.1
- name: configure
run: |
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}} -DCMAKE_CROSSCOMPILING=1 -DFASTFLOAT_TEST=ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- {gen: Visual Studio 17 2022, arch: x64, cfg: Debug}
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v6.0.1
- name: configure
run: |
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}} -DFASTFLOAT_BENCHMARKS=ON -DFASTFLOAT_TEST=ON -DCMAKE_INSTALL_PREFIX:PATH=destination
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-clang-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- {gen: Visual Studio 17 2022, arch: x64, cfg: Debug}
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v6.0.1
- name: Configure
run: |
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}} -DFASTFLOAT_BENCHMARKS=ON -T ClangCL -DFASTFLOAT_TEST=ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-cxx20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- {gen: Visual Studio 17 2022, arch: x64, cfg: Debug}
steps:
- name: checkout
uses: actions/checkout@v6
uses: actions/checkout@v6.0.1
- name: configure
run: >-
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}}
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Jan Pharago
Maya Warrier
Taha Khokhar
Anders Dalvander
Elle Solomina
55 changes: 49 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@

## fast_float number parsing library: 4x faster than strtod

[![Ubuntu 22.04 CI (GCC 11)](https://github.com/fastfloat/fast_float/actions/workflows/ubuntu22.yml/badge.svg)](https://github.com/fastfloat/fast_float/actions/workflows/ubuntu22.yml)
[![Ubuntu 22.04](https://github.com/irainman/fast_float/actions/workflows/ubuntu22.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/ubuntu22.yml)
[![Ubuntu 22.04 clang](https://github.com/irainman/fast_float/actions/workflows/ubuntu22-clang.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/ubuntu22-clang.yml)
[![Ubuntu 24.04](https://github.com/irainman/fast_float/actions/workflows/ubuntu24.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/ubuntu24.yml)
[![Ubuntu 24.04 C++20](https://github.com/irainman/fast_float/actions/workflows/ubuntu24-cxx20.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/ubuntu24-cxx20.yml)
[![Alpine](https://github.com/irainman/fast_float/actions/workflows/alpine.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/alpine.yml)
[![vs17](https://github.com/irainman/fast_float/actions/workflows/vs17-ci.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/vs17-ci.yml)
[![vs17 C++20](https://github.com/irainman/fast_float/actions/workflows/vs17-cxx20.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/vs17-cxx20.yml)
[![vs17 clang](https://github.com/irainman/fast_float/actions/workflows/vs17-clang-ci.yml/badge.svg)](https://github.com/irainman/fast_float/actions/workflows/vs17-clang-ci.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/irainman/fast_float/badge)](https://www.codefactor.io/repository/github/irainman/fast_float)

The fast_float library provides fast header-only implementations for the C++
from_chars functions for `float` and `double` types as well as integer types.
Expand Down Expand Up @@ -35,7 +42,7 @@ struct from_chars_result {
};
```

It parses the character sequence `[first, last)` for a number. It parses
It parses the character sequence `[first, last]` for a number. It parses
floating-point numbers expecting a locale-independent format equivalent to the
C++17 from_chars function. The resulting floating-point value is the closest
floating-point values (using either `float` or `double`), using the "round to
Expand All @@ -48,7 +55,8 @@ parsed value. In case of error, the returned `ec` contains a representative
error, otherwise the default (`std::errc()`) value is stored.

The implementation does not throw and does not allocate memory (e.g., with `new`
or `malloc`).
or `malloc`) and can be usable in the kernel, embeded and other scenarious that
relays on such behavior.

It will parse infinity and nan values.

Expand Down Expand Up @@ -288,7 +296,7 @@ int main() {
}
```

## Advanced options: using commas as decimal separator, JSON and Fortran
## Advanced options: using commas as decimal separator, parse JSON, Fortran and more

The C++ standard stipulate that `from_chars` has to be locale-independent. In
particular, the decimal separator has to be the period (`.`). However, some
Expand Down Expand Up @@ -377,6 +385,42 @@ int main() {
}
```

## You also can use some additional options to maximize performance and reduce size (made by HedgehogInTheCPP):

There is a really common use case in mathematical and other abstract syntax tree (AST)-like parsers that already processes
the sign and all other symbols before any number by itself. In this case you can use FastFloat to only parse positive numbers
in all supported formats with macros `FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN`, which significantly reduce the code size
and improve performance. You also can use macros `FASTFLOAT_ISNOT_CHECKED_BOUNDS` if your code already checks bounds;
it's very likely because all parsers need to check the first character by itself before parsing. Additionally, you can use
macros `FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED` if you only need `FE_TONEAREST` rounding mode in the parsing; this option
also improves performance a bit and reduces code size. In the high-performance example, I also use the [fmt library](https://github.com/fmtlib/fmt), which also
supports all C++ standards since C++11. I also recommend using `string_view` everywhere if it's possible; it's available
since C++17, and if you want maximum performance, use the latest compiler with the latest C++ with maximum optimization:
```
-O3 -DNDEBUG + LTO
```
```C++
#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
#define FASTFLOAT_ISNOT_CHECKED_BOUNDS
#define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
#include "fast_float/fast_float.h"
#include "fmt/base.h"
#include <string_view>

int main() {
std::string_view input = "23.14069263277926900572";
double result;
auto answer = fast_float::from_chars(input.data(), input.data() + input.size(), result);
if ((answer.ec != std::errc()) || ((result != 23.14069263277927 /*properly rounded value */)))
{
fmt::print(stderr, "parsing failure!\n the number {}.", result);
return 1;
}
fmt::print("parsed the number {}.", result);
return 0;
}
```

## Multiplication of an integer by a power of 10
An integer `W` can be multiplied by a power of ten `10^Q` and
converted to `double` with correctly rounded value
Expand Down Expand Up @@ -421,7 +465,6 @@ float: 12345678 * 10^23 = 1.23456782e+30 (==expected)
Overloads of `fast_float::integer_times_pow10()` are provided for
signed and unsigned integer types: `int64_t`, `uint64_t`, etc.


## Users and Related Work

The fast_float library is part of:
Expand Down
5 changes: 5 additions & 0 deletions benchmarks/bench_ip.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

// #define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
// #define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
// #define FASTFLOAT_ISNOT_CHECKED_BOUNDS

#include "counters/bench.h"
#include "fast_float/fast_float.h"
#include <charconv>
Expand Down
Loading