{"id":47719644,"url":"https://github.com/perazz/fortran-fast-float","last_synced_at":"2026-04-02T19:16:33.045Z","repository":{"id":347077902,"uuid":"1179822367","full_name":"perazz/fortran-fast-float","owner":"perazz","description":"Modern Fortran implementation of the fast_float package","archived":false,"fork":false,"pushed_at":"2026-03-26T21:43:40.000Z","size":4880,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T06:12:21.107Z","etag":null,"topics":["eisel-lemire","fast-float","floating-point","floating-point-conversion","fortran","fortran-package-manager","fpm","modern-fortran","parsing","parsing-algorithm","string-to-number"],"latest_commit_sha":null,"homepage":"https://perazz.github.io/fortran-fast-float","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perazz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-12T12:19:04.000Z","updated_at":"2026-03-26T21:43:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/perazz/fortran-fast-float","commit_stats":null,"previous_names":["perazz/fortran-fast-float"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/perazz/fortran-fast-float","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perazz%2Ffortran-fast-float","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perazz%2Ffortran-fast-float/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perazz%2Ffortran-fast-float/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perazz%2Ffortran-fast-float/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perazz","download_url":"https://codeload.github.com/perazz/fortran-fast-float/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perazz%2Ffortran-fast-float/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31314247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eisel-lemire","fast-float","floating-point","floating-point-conversion","fortran","fortran-package-manager","fpm","modern-fortran","parsing","parsing-algorithm","string-to-number"],"created_at":"2026-04-02T19:16:32.208Z","updated_at":"2026-04-02T19:16:33.038Z","avatar_url":"https://github.com/perazz.png","language":"Fortran","readme":"# fortran-fast-float\r\n\r\nA modern Fortran port of the [Eisel-Lemire fast float parsing algorithm](https://github.com/fastfloat/fast_float), via the C99 single-header port [ffc.h](https://github.com/kolemannix/ffc.h).\r\n\r\nParses ASCII decimal strings into `real32`, `real64`, `int32`, and `int64` values with exact rounding, typically 4-10x faster than `read(str, *)`.\r\n\r\n## Getting started\r\n\r\nAdd to your `fpm.toml`:\r\n\r\n```toml\r\n[dependencies]\r\nfortran-fast-float = { git = \"https://github.com/perazz/fortran-fast-float\" }\r\n```\r\n\r\n## Usage\r\n\r\n```fortran\r\nuse fast_float_module, only: parse_double, parse_float, parse_i64, parse_i32\r\n\r\nreal(real64) :: d\r\nreal(real32) :: f\r\ninteger(int64) :: i8\r\ninteger(int32) :: i4\r\n\r\n! Basic parsing (pure elemental)\r\nd = parse_double(\"3.14159265358979323\")\r\nf = parse_float(\"-1.25e-3\")\r\ni8 = parse_i64(\"9223372036854775807\", base=10)\r\ni4 = parse_i32(\"FF\", base=16)\r\n```\r\n\r\n### Error handling\r\n\r\nStandard variants return a `parse_result` with position and outcome:\r\n\r\n```fortran\r\nuse fast_float_module, only: parse_double, parse_result, outcomes\r\n\r\ntype(parse_result) :: res\r\nreal(real64) :: val\r\n\r\nval = parse_double(\"1.0e999\", res=res)\r\nif (res%outcome == outcomes%OUT_OF_RANGE) print *, \"overflow\"\r\nif (res%outcome == outcomes%INVALID_INPUT) print *, \"bad input\"\r\n```\r\n\r\n### Format options\r\n\r\n```fortran\r\nuse fast_float_module, only: parse_double, parse_options, \u0026\r\n    PRESET_GENERAL, PRESET_JSON, PRESET_FORTRAN\r\n\r\n! Fortran D-exponent notation\r\nd = parse_double(\"1.5D-10\", parse_options(format=PRESET_FORTRAN))\r\n\r\n! Custom decimal separator\r\nd = parse_double(\"3,14\", parse_options(decimal_point=','))\r\n```\r\n\r\n## Building\r\n\r\n```bash\r\nfpm build\r\nfpm test\r\n```\r\n\r\n## Benchmarks\r\n\r\nRun with `fpm test --profile release --target benchmark_compare` on Apple Silicon (M1 Max).\r\nData files from [simple_fastfloat_benchmark](https://github.com/lemire/simple_fastfloat_benchmark).\r\nUse `./run_benchmarks.sh` to run the full suite (random + data files) with C++ comparison.\r\n\r\n### Random uniform [0,1) -- 100k floats, 2.10 MB\r\n\r\n```\r\nnetlib              (C)                 :   403.76 MB/s (+/- 1.5 %)    19.24 Mfloat/s\r\nstrtod              (C)                 :   786.63 MB/s (+/- 1.3 %)    37.49 Mfloat/s\r\nabseil              (C++)               :   917.36 MB/s (+/- 0.9 %)    43.72 Mfloat/s\r\nfastfloat           (C++)               :  1586.85 MB/s (+/- 1.3 %)    75.63 Mfloat/s\r\nffc                 (C)                 :  1650.41 MB/s (+/- 1.3 %)    78.66 Mfloat/s\r\nfortran (fast_float)                    :   876.76 MB/s (+/- 0.7 %)    41.79 Mfloat/s\r\nfortran (stdlib to_num)                 :  1066.10 MB/s (+/- 1.0 %)    50.81 Mfloat/s\r\nfortran (str2real)                      :   609.20 MB/s (+/- 0.7 %)    29.04 Mfloat/s\r\nfortran (read *)                        :    56.90 MB/s (+/- 0.4 %)     2.71 Mfloat/s\r\nffc via fortran interop                 :  1493.30 MB/s (+/- 1.4 %)    71.17 Mfloat/s\r\n```\r\n\r\n### canada_short.txt -- 111k lines, 0.70 MB\r\n\r\n```\r\nnetlib              (C)                 :   546.31 MB/s (+/- 4.0 %)   101.50 Mfloat/s\r\nstrtod              (C)                 :   367.00 MB/s (+/- 0.9 %)    68.19 Mfloat/s\r\nabseil              (C++)               :   361.36 MB/s (+/- 1.2 %)    67.14 Mfloat/s\r\nfastfloat           (C++)               :   566.31 MB/s (+/- 1.0 %)   105.22 Mfloat/s\r\nffc                 (C)                 :   704.02 MB/s (+/- 1.1 %)   130.81 Mfloat/s\r\nfortran (fast_float)                    :   638.99 MB/s (+/- 1.4 %)   118.72 Mfloat/s\r\nfortran (stdlib to_num)                 :   710.33 MB/s (+/- 3.1 %)   131.98 Mfloat/s\r\nfortran (str2real)                      :   243.62 MB/s (+/- 0.4 %)    45.27 Mfloat/s\r\nfortran (read *)                        :    22.14 MB/s (+/- 0.6 %)     4.11 Mfloat/s\r\nffc via fortran interop                 :   598.70 MB/s (+/- 4.8 %)   111.24 Mfloat/s\r\n```\r\n\r\n### canada.txt -- 111k lines, 2.04 MB\r\n\r\n```\r\nnetlib              (C)                 :   384.11 MB/s (+/- 0.9 %)    22.07 Mfloat/s\r\nstrtod              (C)                 :   686.30 MB/s (+/- 1.0 %)    39.44 Mfloat/s\r\nabseil              (C++)               :   868.22 MB/s (+/- 1.2 %)    49.89 Mfloat/s\r\nfastfloat           (C++)               :  1095.50 MB/s (+/- 1.1 %)    62.95 Mfloat/s\r\nffc                 (C)                 :  1169.13 MB/s (+/- 1.5 %)    67.19 Mfloat/s\r\nfortran (fast_float)                    :  1036.86 MB/s (+/- 0.7 %)    59.58 Mfloat/s\r\nfortran (stdlib to_num)                 :  1038.53 MB/s (+/- 1.0 %)    59.68 Mfloat/s\r\nfortran (str2real)                      :   452.02 MB/s (+/- 0.4 %)    25.98 Mfloat/s\r\nfortran (read *)                        :    49.86 MB/s (+/- 0.7 %)     2.87 Mfloat/s\r\nffc via fortran interop                 :  1048.10 MB/s (+/- 1.6 %)    60.23 Mfloat/s\r\n```\r\n\r\n### mesh.txt -- 73k lines, 0.61 MB\r\n\r\n```\r\nnetlib              (C)                 :   537.91 MB/s (+/- 2.1 %)    73.28 Mfloat/s\r\nstrtod              (C)                 :   522.81 MB/s (+/- 1.2 %)    71.22 Mfloat/s\r\nabseil              (C++)               :   415.05 MB/s (+/- 1.3 %)    56.54 Mfloat/s\r\nfastfloat           (C++)               :   825.10 MB/s (+/- 1.1 %)   112.40 Mfloat/s\r\nffc                 (C)                 :   947.22 MB/s (+/- 1.3 %)   129.04 Mfloat/s\r\nfortran (fast_float)                    :   885.97 MB/s (+/- 0.9 %)   120.69 Mfloat/s\r\nfortran (stdlib to_num)                 :   796.45 MB/s (+/- 1.2 %)   108.50 Mfloat/s\r\nfortran (str2real)                      :   298.61 MB/s (+/- 2.4 %)    40.68 Mfloat/s\r\nfortran (read *)                        :    28.21 MB/s (+/- 0.6 %)     3.84 Mfloat/s\r\nffc via fortran interop                 :   838.82 MB/s (+/- 2.1 %)   114.27 Mfloat/s\r\n```\r\n\r\n## Acknowledgements\r\n\r\nThis library is a Fortran translation of the Eisel-Lemire algorithm. Credit goes to:\r\n\r\n- **[fast_float](https://github.com/fastfloat/fast_float)** by Daniel Lemire and contributors -- the original C++ implementation. Licensed under Apache-2.0, BSL-1.0, and MIT.\r\n- **[ffc.h](https://github.com/kolemannix/ffc.h)** by Koleman Nix and contributors -- the C99 single-header port used as the direct reference for this Fortran translation. Licensed under Apache-2.0, BSL-1.0, and MIT.\r\n\r\n## License\r\n\r\nLicensed under your choice of:\r\n\r\n- [Apache License, Version 2.0](LICENSE-APACHE)\r\n- [Boost Software License, Version 1.0](LICENSE-BOOST)\r\n- [MIT License](LICENSE-MIT)\r\n\r\nmatching the upstream projects.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperazz%2Ffortran-fast-float","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperazz%2Ffortran-fast-float","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperazz%2Ffortran-fast-float/lists"}