mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-09 11:16:45 +08:00
Merge branch 'main' of https://github.com/fastfloat/fast_float
This commit is contained in:
commit
3695153f1f
2
.github/workflows/alpine.yml
vendored
2
.github/workflows/alpine.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
- riscv64
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
|
||||
- name: Install latest Alpine Linux for ${{ matrix.arch }}
|
||||
uses: jirutka/setup-alpine@v1
|
||||
|
||||
2
.github/workflows/amalgamate-ubuntu24.yml
vendored
2
.github/workflows/amalgamate-ubuntu24.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
ubuntu-build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Compile with amalgamation
|
||||
run: |
|
||||
mkdir build &&
|
||||
|
||||
2
.github/workflows/msys2-clang.yml
vendored
2
.github/workflows/msys2-clang.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
|
||||
2
.github/workflows/msys2.yml
vendored
2
.github/workflows/msys2.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
|
||||
2
.github/workflows/on-release.yml
vendored
2
.github/workflows/on-release.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
|
||||
- name: Amalgamate fast_float.h
|
||||
run: |
|
||||
|
||||
2
.github/workflows/risc.yml
vendored
2
.github/workflows/risc.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get update -q -y
|
||||
|
||||
2
.github/workflows/s390x.yml
vendored
2
.github/workflows/s390x.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- uses: uraimo/run-on-arch-action@v3
|
||||
name: Test
|
||||
id: runcmd
|
||||
|
||||
2
.github/workflows/ubuntu22-clang.yml
vendored
2
.github/workflows/ubuntu22-clang.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
ubuntu-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Install clang++-14
|
||||
run: sudo apt-get install -y clang++-14
|
||||
- name: Use cmake
|
||||
|
||||
2
.github/workflows/ubuntu22-gcc12.yml
vendored
2
.github/workflows/ubuntu22-gcc12.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
ubuntu-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Use cmake
|
||||
run: |
|
||||
mkdir build &&
|
||||
|
||||
2
.github/workflows/ubuntu22-sanitize.yml
vendored
2
.github/workflows/ubuntu22-sanitize.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
ubuntu-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Use cmake
|
||||
run: |
|
||||
mkdir build &&
|
||||
|
||||
2
.github/workflows/ubuntu22.yml
vendored
2
.github/workflows/ubuntu22.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
ubuntu-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Use cmake
|
||||
run: |
|
||||
mkdir build &&
|
||||
|
||||
2
.github/workflows/ubuntu24-cxx20.yml
vendored
2
.github/workflows/ubuntu24-cxx20.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Use cmake
|
||||
run: |
|
||||
mkdir build &&
|
||||
|
||||
2
.github/workflows/ubuntu24.yml
vendored
2
.github/workflows/ubuntu24.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
ubuntu-build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v6.0.2
|
||||
- name: Use cmake
|
||||
run: |
|
||||
set -xe
|
||||
|
||||
2
.github/workflows/vs17-arm-ci.yml
vendored
2
.github/workflows/vs17-arm-ci.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
||||
- {gen: Visual Studio 17 2022, arch: ARM64, cfg: Debug}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
- name: configure
|
||||
run: |
|
||||
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}} -DCMAKE_CROSSCOMPILING=1 -DFASTFLOAT_TEST=ON
|
||||
|
||||
2
.github/workflows/vs17-ci.yml
vendored
2
.github/workflows/vs17-ci.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- {gen: Visual Studio 17 2022, arch: x64, cfg: Debug}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
- name: configure
|
||||
run: |
|
||||
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}} -DFASTFLOAT_BENCHMARKS=ON -DFASTFLOAT_TEST=ON -DCMAKE_INSTALL_PREFIX:PATH=destination
|
||||
|
||||
2
.github/workflows/vs17-clang-ci.yml
vendored
2
.github/workflows/vs17-clang-ci.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- {gen: Visual Studio 17 2022, arch: x64, cfg: Debug}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}} -DFASTFLOAT_BENCHMARKS=ON -T ClangCL -DFASTFLOAT_TEST=ON
|
||||
|
||||
2
.github/workflows/vs17-cxx20.yml
vendored
2
.github/workflows/vs17-cxx20.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- {gen: Visual Studio 17 2022, arch: x64, cfg: Debug}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
- name: configure
|
||||
run: >-
|
||||
cmake -S . -B build -G "${{matrix.gen}}" -A ${{matrix.arch}}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
|
||||
project(fast_float VERSION 8.2.2 LANGUAGES CXX)
|
||||
project(fast_float VERSION 8.2.3 LANGUAGES CXX)
|
||||
set(FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat")
|
||||
set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD})
|
||||
option(FASTFLOAT_TEST "Enable tests" OFF)
|
||||
@ -57,13 +57,7 @@ if(FASTFLOAT_SANITIZE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
unset(FASTFLOAT_COMPILER_SUPPORTS_PERMISSIVE)
|
||||
CHECK_CXX_COMPILER_FLAG(/permissive- FASTFLOAT_COMPILER_SUPPORTS_PERMISSIVE)
|
||||
|
||||
if(FASTFLOAT_COMPILER_SUPPORTS_PERMISSIVE)
|
||||
target_compile_options(fast_float INTERFACE /permissive-)
|
||||
endif()
|
||||
target_compile_options(fast_float INTERFACE $<$<AND:$<CXX_COMPILER_ID:MSVC>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,19.10>>:/permissive->)
|
||||
|
||||
if(FASTFLOAT_INSTALL)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
13
README.md
13
README.md
@ -149,9 +149,12 @@ Furthermore, we have the following restrictions:
|
||||
fixed-width floating-point types such as `std::float64_t`, `std::float32_t`,
|
||||
`std::float16_t`, and `std::bfloat16_t`.
|
||||
* We only support the decimal format: we do not support hexadecimal strings.
|
||||
* For values that are either very large or very small (e.g., `1e9999`), we
|
||||
represent it using the infinity or negative infinity value and the returned
|
||||
* For values that are very large positives or negatives (e.g., `1e9999`), we
|
||||
represent them using a positive or negative infinity and the returned
|
||||
`ec` is set to `std::errc::result_out_of_range`.
|
||||
* For values that are very close to zero (e.g., `1e-9999`), we represent them
|
||||
using a positive or negative zero and the returned `ec` is set to
|
||||
`std::errc::result_out_of_range`.
|
||||
|
||||
We support Visual Studio, macOS, Linux, freeBSD. We support big and little
|
||||
endian. We support 32-bit and 64-bit systems.
|
||||
@ -576,7 +579,7 @@ sufficiently recent version of CMake (3.11 or better at least):
|
||||
FetchContent_Declare(
|
||||
fast_float
|
||||
GIT_REPOSITORY https://github.com/fastfloat/fast_float.git
|
||||
GIT_TAG tags/v8.2.2
|
||||
GIT_TAG tags/v8.2.3
|
||||
GIT_SHALLOW TRUE)
|
||||
|
||||
FetchContent_MakeAvailable(fast_float)
|
||||
@ -592,7 +595,7 @@ You may also use [CPM](https://github.com/cpm-cmake/CPM.cmake), like so:
|
||||
CPMAddPackage(
|
||||
NAME fast_float
|
||||
GITHUB_REPOSITORY "fastfloat/fast_float"
|
||||
GIT_TAG v8.2.2)
|
||||
GIT_TAG v8.2.3)
|
||||
```
|
||||
|
||||
## Using as single header
|
||||
@ -604,7 +607,7 @@ if desired as described in the command line help.
|
||||
|
||||
You may directly download automatically generated single-header files:
|
||||
|
||||
<https://github.com/fastfloat/fast_float/releases/download/v8.2.2/fast_float.h>
|
||||
<https://github.com/fastfloat/fast_float/releases/download/v8.2.3/fast_float.h>
|
||||
|
||||
## Benchmarking
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
#define FASTFLOAT_VERSION_MAJOR 8
|
||||
#define FASTFLOAT_VERSION_MINOR 2
|
||||
#define FASTFLOAT_VERSION_PATCH 2
|
||||
#define FASTFLOAT_VERSION_PATCH 3
|
||||
|
||||
#define FASTFLOAT_STRINGIZE_IMPL(x) #x
|
||||
#define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user