477 Commits

Author SHA1 Message Date
HedgehogInTheCPP
cfd0963705
Merge branch 'main' into main 2025-03-12 17:16:03 +03:00
IRainman
681346fde1 Merge branch 'main' of https://github.com/fastfloat/fast_float into fastfloat-main 2025-03-12 17:00:35 +03:00
Daniel Lemire
50a80a73ab v8.0.2 2025-03-11 09:51:53 -04:00
Daniel Lemire
1bf7010153 v8.0.1 2025-03-10 09:04:05 -04:00
Daniel Lemire
c6732cd28b lint 2025-03-10 09:02:38 -04:00
IRainman
6c499fda5c FASTFLOAT_ASSUME review. 2025-03-10 05:34:45 +03:00
Daniel Lemire
b29208f93d adding FASTFLOAT_IF_CONSTEXPR17 2025-03-09 17:10:55 -04:00
IRainman
63eb578d52 Add FASTFLOAT_HAS_BYTESWAP check.
Improve FASTFLOAT_CONSTEVAL20 usage for older standards.
2025-03-09 22:55:04 +03:00
Daniel Lemire
6f0049a2e7 lint 2025-03-09 15:14:52 -04:00
Daniel Lemire
95dedd0aed turning json option into macro parameter 2025-03-09 15:13:43 -04:00
IRainman
354f4c3eac Compilation fix. 2025-03-09 21:09:51 +03:00
IRainman
c2daa8a614 Added FASTFLOAT_ASSUME for support attribute [[assume]] is declared in P1774 2025-03-09 03:41:27 +03:00
IRainman
f496321570 Completely remove deprecated macroses FASTFLOAT_ALLOWS_LEADING_PLUS and FASTFLOAT_SKIP_WHITE_SPACE, please use options.
Compilation fix when FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN isn't defined.
2025-03-09 02:37:46 +03:00
IRainman
ae29a0dbe5 PVS-Studio founds some errors, I fixed it. 2025-03-07 20:39:20 +03:00
IRainman
388426e35a fix type conversion warning. 2025-03-07 15:06:44 +03:00
IRainman
aba93f306f Additional compile time cleanup. When FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN is enabled we assume that we are in parser code with external loop that checks bounds.
Function cpp20_and_in_constexpr() now is really compile time evaluated. TODO fix warnings.
2025-03-07 14:51:20 +03:00
IRainman
bc3f331938 # cleanup. 2025-03-06 23:02:50 +03:00
IRainman
7a38e1bc75 fix for 32 bit build. completely done. All other parser mode also work fine. 2025-03-06 22:47:47 +03:00
IRainman
9ebac23081 Added a config option FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN for faster and more compact code parsing numbers with input support only positive C/C++ style numbers without nan or inf. That case is very useful in mathematical applications, game development, CSS parsing, embedded code, etc...
Additional improve in constant initialization.
2025-03-06 22:25:05 +03:00
IRainman
28795646ab more const 2025-03-06 19:43:47 +03:00
IRainman
63f6abebdf * Added an option disallow_leading_sign and stronger constexpr / consteval, also significantly reduce register pressure by reducing copy of constant data. 2025-03-06 18:29:16 +03:00
Joao Paulo Magalhaes
3e9dc96eb4 Fix -Wundef warnings seen in gcc 4.8 and 4.9 2025-02-13 08:45:11 +00:00
Joao Paulo Magalhaes
9cfa5ff4a0 fix warnings from -Wundef 2025-02-12 23:51:44 +00:00
Daniel Lemire
77cc847c84 pushing version change 2025-02-08 11:49:58 -05:00
Daniel Lemire
7a5ee5af60
Merge pull request #296 from dalle/dalle/float16
16-bit float support
2025-02-06 19:41:37 -05:00
Daniel Lemire
1d50f57dd9 better wording. 2025-02-06 00:16:28 -05:00
Johan Råde
d4d5748ec8 Silenced Visual Studio compiler warning
This code caused a C4127 "conditional expression is constant" compiler warning
when compiled with Visual Studio at warning level 4 with T a signed integer type.
2025-01-16 16:12:34 +01:00
Anders Dalvander
ce274f7051 include and order types largerst to smallest 2024-12-04 10:17:05 +01:00
Anders Dalvander
7226c00490 cleanup 2024-12-04 09:35:32 +01:00
Anders Dalvander
2a6c2604b5 check for IEEE 754 compliance 2024-12-04 09:34:34 +01:00
Anders Dalvander
62f526dfd3 fix -Werror=conversion 2024-12-03 23:52:57 +01:00
Anders Dalvander
da819feb74 back to std::bit_cast 2024-12-03 23:23:35 +01:00
Anders Dalvander
8cee025082 add powers_of_ten/max_mantissa for float16_t/bfloat16_t 2024-12-03 23:23:34 +01:00
Daniel Lemire
6f8fd6728d make it build 2024-12-03 23:23:34 +01:00
Daniel Lemire
bfcff49c83 16-bit float support 2024-12-03 23:23:34 +01:00
Anders Dalvander
3775a81ced formatted code 2024-12-01 16:39:28 +01:00
Anders Dalvander
0a1bf11560 harmonize ifdef checks 2024-12-01 16:36:45 +01:00
Anders Dalvander
3146e686d0 introduce equiv_uint_t 2024-12-01 16:36:17 +01:00
Anders Dalvander
d3f7113d6e add char8_t support 2024-11-23 10:21:48 +01:00
Anders Dalvander
1a15c66fb9 harmonize files to use "east const"
manually checked modified files for errors, but not committing .clang-format due to the following warning:
>>> Setting `QualifierAlignment` to something other than `Leave`, COULD lead to incorrect code formatting due to incorrect decisions made due to clang-formats lack of complete semantic information. As such extra care should be taken to review code changes made by the use of this option.
2024-11-23 09:46:18 +01:00
Anders Dalvander
7f476cd259 fix clang unused-function warning 2024-11-23 09:04:46 +01:00
Daniel Lemire
cf771eaa83
Merge pull request #283 from dalle/issue282-better-error-messages
Better compile time error messages for unsupported types
2024-11-22 13:09:49 -05:00
Anders Dalvander
35d0c8c179 add version macros 2024-11-22 16:44:56 +01:00
Anders Dalvander
74829bb77d better compile time error messages for unsupported types 2024-11-22 16:25:31 +01:00
Anders Dalvander
50ee38af65 fix for fastfloat_strncasecmp for wchar_t and larger char types 2024-11-21 00:09:05 +01:00
Anders Dalvander
7ff885d45c fix for is_space for wchar_t and larger char types 2024-11-21 00:09:00 +01:00
Anders Dalvander
48252a6483 check feature macros in once place 2024-11-21 00:08:19 +01:00
Anders Dalvander
0bbba960f4 move from feature macros to format flags 2024-11-21 00:06:08 +01:00
Anders Dalvander
b3526da935 uint64_t as enum base for chars_format 2024-11-20 23:01:56 +01:00
Anders Dalvander
b8b5da75a5 enum class chars_format 2024-11-20 09:33:16 +01:00
Anders Dalvander
b635dec11a clang format 2024-11-19 10:32:37 +01:00
Anders Dalvander
23787fc71a fix #276: parse_infnan handles FASTFLOAT_ALLOWS_LEADING_PLUS correctly 2024-11-17 16:23:01 +01:00
Anders Dalvander
72b2a7382a const ness 2024-11-17 16:22:05 +01:00
Anders Dalvander
269867fa43 spelling 2024-11-17 16:17:35 +01:00
Evgeny Karpov
c9f8339668 Fix the formatting and remove the previous condition 2024-09-02 18:13:01 +02:00
Evgeny Karpov
2609d5fd4b The patch resolves GCC compilation issues for the C++ language targeting
aarch64-w64-mingw32.

More information could be found here:
https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662020.html
2024-09-02 17:24:33 +02:00
Yedidya Feldblum
159589d356 remove out-of-line defns of constexpr static data members under c++17
Address warnings of this form under c++17 when building with `-Werror -Wdeprecated`:
```
fast_float/float_common.h:446:58: error: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Werror,-Wdeprecated]
constexpr double binary_format_lookup_tables<double, U>::powers_of_ten[];
                                                         ^
```
2024-08-30 10:30:40 -05:00
Daniel Lemire
5ad6aae0b1 lint 2024-08-14 09:57:47 -04:00
Leszek Swirski
74e3c29215 Include intrin.h for __umulh
Arm64 uses __umulh, so add the same condition for including the intrin.h
header.
2024-08-14 15:10:14 +02:00
Daniel Lemire
d57ca3da1f
Merge pull request #259 from fastfloat/issue258
issue 258
2024-08-03 16:38:10 -04:00
Daniel Lemire
207d66162a issue 258 2024-08-03 10:02:42 -04:00
Leszek Swirski
b6ce2c4de6 Record parse failure reason and location
In parse_number_string, if there is a parse error, report the specific
error as one of the values in a new parse_error enum, and update
lastmatch to match the error location. This allows users of the library
to print more helpful error messages for invalid inputs.
2024-07-23 18:11:10 +02:00
Leszek Swirski
e6777f2eef Allow JSON empty exponent as trailing junk
Revert #251, and instead allow an invalid trailing empty exponent to be
treated as junk data in JSON parsing. Expand the test suite to test this
case, including testing the trailing junk.
2024-07-23 14:56:42 +02:00
Daniel Lemire
ef9a60d516 update CI to ubuntu 24 + safe a shift value to a variable (for elegance) 2024-07-22 09:36:14 -04:00
Leszek Swirski
b57207c811 Disallow empty exponent in JSON parsing
The JSON spec requires at least one digit in the exponential part, if
specified.
2024-07-22 12:34:58 +02:00
Daniel Lemire
92c79d078b
Merge pull request #249 from zejal/main
from_chars_advanced overload function taking parsed_number_string_t
2024-07-16 10:17:08 -04:00
Daniel Lemire
c8b3ca0d12
Merge pull request #167 from deadalnix/smallest_power_of_ten
Change smallest_power_of_ten to -64 for floats.
2024-06-27 19:03:59 -04:00
zejal
85911abb59 added couple of comments 2024-05-13 19:55:46 +02:00
zejal
1f9b1a6706 from_chars_advanced overload function taking parsed_number_string_t 2024-05-13 14:24:48 +02:00
Daniel Lemire
56a0092895 removing unused function 2024-03-20 14:24:16 -04:00
Matthew Wozniczka
9ab4ac837b
Add a missing check that __uint128_t exists before using it.
I noticed a compilation error when building a 64-bit binary with this library while using xlclang on AIX, and this change seems to fix it.
2024-03-16 12:18:20 -07:00
Marcin Wojdyr
55a5b3c8e1 check C++ standard version before including <stdfloat>
fixes #238
2024-02-03 15:05:30 +01:00
Daniel Lemire
12ece3c84f removing leftover print 2024-01-28 15:20:41 -05:00
Daniel Lemire
a0ea962bf5 more fixes 2024-01-28 15:18:40 -05:00
Daniel Lemire
eb584f748e explicit cast 2024-01-28 13:29:55 -05:00
Daniel Lemire
9da74ca5fb minor fixes 2024-01-28 12:49:00 -05:00
Daniel Lemire
fade2357ba fix missing typename 2024-01-28 11:46:27 -05:00
Daniel Lemire
c7e45fea9f
Merge pull request #229 from MTahaK/main
Support for float32_t and float64_t
2024-01-28 11:43:54 -05:00
Daniel Lemire
1d97749791 Verify and fix issue 235 2024-01-28 10:47:21 -05:00
Daniel Lemire
620376ad39
Merge branch 'main' into main 2024-01-28 10:09:56 -05:00
Darrell Wright
b43f808190
Update float_common.h
The construct !! is a no-op for a bool, op< for uint64_t's.  Removed it and made it an explicit cast to match the operations being performed
2023-12-27 19:43:56 -05:00
Maya Warrier
882a716c12
Explicit curly bracket where suggested
Co-authored-by: Daniel Lemire <daniel@lemire.me>
2023-12-14 16:28:23 -05:00
Maya Warrier
a59a62cb5c
Merge branch 'fastfloat:main' into main 2023-12-13 17:54:05 -05:00
Maya Warrier
bdee16bcad - Add SIMD acceleration to fast_int
- fix MSVC warning
2023-12-13 17:42:30 -05:00
Maya Warrier
36aaded3dd Fix handling of leading zeros 2023-12-13 17:11:41 -05:00
Maya Warrier
1e0a9da538 Change FASTLOAT_ARM64 macro to FASTFLOAT_NEON 2023-12-13 00:56:35 -05:00
MTahaK
96c0059fe9 Revised implementation of float32_t and float64_t support as template specializations, added test 2023-12-13 00:33:16 -05:00
Maya Warrier
a30fe866f6 Fix bugs highlighted in tests 2023-12-12 22:35:58 -05:00
Maya Warrier
624ba49434 Fix more Werrors
- Werror=conversion,char-subscripts
2023-12-12 21:26:48 -05:00
MTahaK
4d8a2f4000 Fixed typo. 2023-12-12 19:02:10 -05:00
MTahaK
f330ec1e9d Reverted CMakeLists changes, modifed workflow for g++13 & C++23. 2023-12-12 18:59:59 -05:00
MTahaK
d10980bc9f Added conditions to include stdfloat, and new workflow for GCC 13 2023-12-12 18:46:38 -05:00
MTahaK
62a4129a1c Fixed ifdef macro 2023-12-12 18:18:13 -05:00
MTahaK
eb844a1ad9 Modified cmakelist to use C++23. Fixed ifdef for fixed-width float types 2023-12-12 18:16:27 -05:00
MTahaK
cbbbc75c88 Fixed ifdef checks (incorrect syntax) 2023-12-12 17:59:04 -05:00
MTahaK
d8dbbc54ab Updated comment for float32_t and float64_t conversions in from_chars 2023-12-12 17:56:14 -05:00
MTahaK
f74e338e0a Added trivial support for float32_t and float64_t 2023-12-12 16:38:48 -05:00
Maya Warrier
7a21a8d6d7 Return invalid_argument in more places 2023-12-12 02:36:18 -05:00
Maya Warrier
3d446f1eba Fix gcc werrors 2023-12-12 01:56:24 -05:00
Maya Warrier
c9527c2e4f Skip leading zeros 2023-12-11 04:27:22 -05:00
Maya Warrier
122220e2f0 Version 1 of from_chars integer parser 2023-12-11 04:17:26 -05:00
Daniel Lemire
35d523195b
Merge pull request #225 from fastfloat/fix_win32_ci
fix for 32-bit Visual Studio when not set to round to nearest
2023-11-27 16:21:01 -05:00
Daniel Lemire
fda97168f0 casting to avoid warnings 2023-11-27 15:50:47 -05:00
Daniel Lemire
70d8e0ad0e In some cases, Visual Studio, when compiling 32-bit binaries, gets
0*something == -0 even when the 'something' is positive, when the system
is not set to compile to nearest.
2023-11-27 15:44:24 -05:00
Antoine Cœur
c325db1b04 float_common.h:237:52 Value stored to 'input_num' is never read 2023-11-25 18:45:15 +01:00
Daniel Lemire
7646f819a8 Merge branch 'main' of github.com:allenbarnett5/fast_float_ftn into fortran 2023-09-15 09:43:27 -04:00
Maya Warrier
7b1fc2f95d Add an option to allow inf/nan even in json mode
- Most JSON parsers offer this option too
2023-09-14 21:07:22 -04:00
Maya Warrier
ce562d9c65 Disallow inf/nan in json mode 2023-09-14 20:51:26 -04:00
Maya Warrier
2395482ad5 Ignore FASTFLOAT_ALLOWS_LEADING_PLUS for JSON format 2023-09-14 19:50:21 -04:00
Maya Warrier
4de8d715e6 Add json fmt test 2023-09-13 21:07:40 -04:00
Maya Warrier
3f250c5a98 Use chars_format instead of parse_rules for parsing as JSON 2023-09-13 20:03:10 -04:00
Maya Warrier
396f41271f Implement JSON rules 2023-09-13 19:19:37 -04:00
allen.barnett@paperbirchsoftware.com
e22c027544 Allow fast_float to parse strings accepted by the Fortran internal read
function.
2023-08-07 08:39:06 -04:00
deadalnix
5167a5029d Change smallest_power_of_ten to -64 for floats.
`18446744073709551615e-65` rounds to `0`, and it is the largest possible value with exponent `-65`. Therefore, we can assume the minimal exponent for which we don't round to zero actually is `-64`.
2023-07-12 14:27:46 +00:00
Cœur
3e90425e3c code review: FASTFLOAT_CONSTEXPR14 2023-06-12 22:27:31 +02:00
Cœur
f5f64e46cd float_common.h: fix possible misuse of comma operator 2023-06-12 21:05:51 +02:00
Maya Warrier
c5ecb5db9b Fix for MSVC v140 2023-06-11 22:22:06 -04:00
Daniel Lemire
c80ff7c18a
Merge pull request #212 from fastfloat/issue211
Renaming the using for the local type.
2023-06-10 10:49:03 -04:00
Daniel Lemire
a14f8c587e Fix. 2023-06-10 10:48:46 -04:00
Daniel Lemire
eea6fef9a1 tweak 2023-06-10 09:47:48 -04:00
Daniel Lemire
ba328bbf7d Renaming the using for the local type. 2023-06-10 09:44:49 -04:00
Pharago
b8e3307fbd Fix broken msvc v140
When using msvc v140 (Visual Studio 2015 Toolset), compilation fails.
2023-06-10 05:46:30 +02:00
Daniel Lemire
3cab724b80 Minor fixes 2023-06-09 12:30:20 -04:00
Daniel Lemire
b88345d06d Fixes 2023-06-09 11:28:51 -04:00
Daniel Lemire
e8c0378d6d Adding ARM NEON optimizations. 2023-06-09 11:19:34 -04:00
Daniel Lemire
8139e164b8
Merge pull request #198 from mayawarrier/main
Add opt-in SIMD support for char16_t
2023-06-09 10:40:04 -04:00
v1gnesh
bb2ae14fe6
Add zOS support to float_common.h 2023-06-05 19:16:46 +05:30
zangruochen
fcee052311 Support LoongArch64 2023-05-30 15:16:27 +08:00
Maya Warrier
a5632d5b57 Fix digit comparison, cleanup 2023-05-20 12:29:24 -04:00
Maya Warrier
cb397ef446 Fix for clang (missing _mm_cvtsi128_si64x) 2023-05-17 05:40:29 -04:00
Maya Warrier
1c9a3088bf Fix for VS 32-bit 2023-05-17 05:31:15 -04:00
Maya Warrier
064d2b832d Fix Werrors 2023-05-17 02:27:48 -04:00
Maya Warrier
38613a39f9 Fix perf decrease when UC = char 2023-05-17 01:34:33 -04:00
Maya Warrier
6ede038789 Apply changes from benchmarked version
- Move parse_truncated_number_string back inside parse_number_string
2023-05-09 22:19:23 -04:00
Daniel Lemire
396a0fc2ae
Merge branch 'main' into main 2023-05-08 16:44:35 -04:00
Daniel Lemire
cc1e01e9ee
Merge pull request #199 from mayawarrier/cmake_intellisense_fix
Fix for broken VS Intellisense
2023-05-08 16:43:45 -04:00
Lenard Szolnoki
ddaefc0bbf Fix multiple definition linker errors for tables 2023-05-08 15:24:11 +01:00
Lenard Szolnoki
cc042ae409 Make lookup tables external linkage 2023-05-07 23:07:34 +01:00
Maya Warrier
53b065f38d Avoid redundant load in SSE2 code 2023-05-07 17:38:32 -04:00
Maya Warrier
4e7ae339d6 Implement intellisense fix 2023-05-07 00:38:10 -04:00
Maya Warrier
4cb09b5f59 Automatically detect SSE2 2023-05-02 13:05:57 -04:00
Maya Warrier
c811b027ea Remove testing macro 2023-05-02 01:52:00 -04:00
Maya Warrier
5136b181ba Fixes and cleanup 2023-05-02 01:41:49 -04:00
Maya Warrier
680ccc73ed Merge from upstream/main, fix conflicts 2023-05-01 20:27:29 -04:00
Maya Warrier
e08c55c380 Remove json parse rules/allow inf_nan 2023-05-01 19:45:50 -04:00
Maya Warrier
091458d192 Add basic support for char32_t (unoptimized) 2023-04-30 02:23:33 -04:00
Daniel Lemire
8199baeb70 Slightly less ugly code. 2023-04-26 18:46:19 -04:00
Daniel Lemire
225df8c934
Merge branch 'fastfloat:main' into other_chars 2023-04-26 18:32:06 -04:00
Daniel Lemire
5223d7a460 address issues raised by @mayawarrier 2023-04-26 18:25:27 -04:00
Maya Warrier
65bd922e38 Merge remote-tracking branch 'upstream/main'
- Fix conflicts
2023-04-26 16:47:42 -04:00
Daniel Lemire
927eb9bcd2 Merge branch 'main' of https://github.com/Pharago/fast_float into other_chars 2023-04-26 16:40:09 -04:00
Maya Warrier
89fc24007a Clean up 2023-04-26 16:25:41 -04:00
Maya Warrier
653790b5f3 fixes 2023-04-16 00:36:52 -04:00
Maya Warrier
c849b7a8ff Option to forbid nan/inf, refactor 2023-04-15 23:16:01 -04:00
Daniel Lemire
11eeab5463 Removing dead code. 2023-04-11 14:29:30 -04:00
Pharago
ece3b3886b Fix storage class errors on non msvc builds
Removed storage class declarations from explicit template specializations of string constants
2023-04-06 20:58:31 +02:00
Pharago
2bfbe4ca96 cosmetic changes 2023-04-06 00:58:34 +02:00
Pharago
593709f056
Merge branch 'main' into main 2023-04-05 03:31:35 +02:00
Aras Pranckevičius
21fefa5b44
Fix warnings with -Wundef
- FASTFLOAT_ALLOWS_LEADING_PLUS and FASTFLOAT_SKIP_WHITE_SPACE are not defined by default, and compiling with -Wundef is emitting warnigns like "FASTFLOAT_ALLOWS_LEADING_PLUS is not defined, evaluates to 0".
- Likewise for FASTFLOAT_VISUAL_STUDIO, change checks to use #ifdef for that like in other places.
- __cpp_lib_bit_cast and __cpp_lib_is_constant_evaluated are not defined pre-C++20, and are emitting a warning too.
2023-04-04 21:18:57 +03:00
Pharago
148606637c
Merge branch 'fastfloat:main' into main 2023-04-03 02:25:46 +02:00
Daniel Lemire
ca43e6722e We need to update some of our exhaustive tests to the new API 2023-04-02 17:43:17 -04:00
Pharago
bc77f956e2 Initial Unicode release
Added support for the other char types
2023-04-02 22:58:01 +02:00
Maya Warrier
cda25408bc Optimize char16_t parsing for digit_comparison.h 2023-04-02 00:33:52 -04:00
Maya Warrier
2d57c09530 Fixes 2023-04-01 23:29:00 -04:00
Maya Warrier
8a9a9d538a SIMD optimization to parse 8 char16_t at a time 2023-04-01 22:43:00 -04:00
Maya Warrier
f59f73c4da Disable simd-related warnings 2023-04-01 04:09:00 -04:00
Maya Warrier
20f3870361 Fixes 2023-03-30 04:58:22 -04:00
Maya Warrier
2b118c843a Experimental support for char_t types 2023-03-30 04:48:18 -04:00
Maya Warrier
b6acf38a2e Fix bugs 2023-03-29 18:42:24 -04:00
Adam Lugowski
bfee511d78 Set errc::result_out_of_range on over/underflow
Best-effort values are still returned, such as 0 for underflow and infinity for overflow, but now the returned ec is set to std::errc::result_out_of_range instead of std::errc().
2023-03-29 10:14:46 -07:00
Maya Warrier
3cafcca2ff Add support for json parsing rules and integers 2023-03-29 02:14:12 -04:00
Maya Warrier
8f94758c78 Expose parsed string (before computation) so it can be reused 2023-03-27 22:50:21 -04:00
Daniel Lemire
b50a729d93
Merge pull request #182 from leni536/constexpr-from_chars
Constexpr from_chars
2023-03-25 17:30:55 -04:00
Lenard Szolnoki
5b8290433c Fix clang workaround for parsing -0 on non-nearest rounding mode 2023-03-25 19:38:44 +00:00
Lenard Szolnoki
e464bd7785 Replace memmove with copy_backward 2023-03-24 17:18:58 +00:00
Lenard Szolnoki
d34d0d7405 Fix amalgamate.ph and add header for constexpr macros 2023-03-12 10:50:25 +00:00
filipecosta90
c8886eb31d Added missing FASTFLOAT_ALLOWS_LEADING_PLUS ifdef check in parse_infnan 2023-03-07 00:31:14 +00:00
Lenard Szolnoki
e05858a0f8 Work around clang bug.
https://godbolt.org/z/zedh7rrhc

This is similar to https://github.com/llvm/llvm-project/issues/47746,
except I needed to use a different workaround.
2023-03-04 23:02:15 +00:00
Lenard Szolnoki
6732e397d8 Add constexpr testing
When enabled, modify `verify` macro to also verify at compile time,
when the arguments are constant expressions.
2023-03-04 22:36:58 +00:00
Lenard Szolnoki
e4d4e43b21 Constexpr from_chars 2023-03-04 20:53:43 +00:00
Lenard Szolnoki
82ee3b1b5f Constexpr parse_number_string 2023-03-04 17:18:25 +00:00
Lenard Szolnoki
5243dd97fe Constexpr bigint 2023-03-03 23:13:52 +00:00
Lenard Szolnoki
52618851fd Make all float_common.h functions constexpr in C++20 2023-03-03 22:43:52 +00:00
Lenard Szolnoki
6d2fb68f5c Simplify to_float
* Use right-sized uint type for bit fiddling
** This removes the need to special casing on endianness
* Replace ternary with just shifting the sign at the right place
** This seems to improve codegen (less instructions, no cmov)
2023-03-01 23:39:01 +00:00
Daniel Lemire
b1d27734c5
Merge pull request #173 from fastfloat/nofallbacknecessary
We do not need a fallback.
2023-02-28 17:19:57 -05:00
Lenard Szolnoki
e320512755 Fix power_of_five_128 to be usable in constexpr in MSVC, clang 2023-02-25 18:34:22 +00:00
Lenard Szolnoki
0e4b873d81 Fix space_lut so it's accepted by MSVC and clang 2023-02-25 18:27:10 +00:00
Lenard Szolnoki
a6991ea44f Add comment to the FASTFLOAT_CONSTEXPR14 macro definition 2023-02-25 11:11:09 +00:00
Lenard Szolnoki
be6084863c Low-risk C++14 constexpr functions 2023-02-25 10:50:45 +00:00
Daniel Lemire
252a1c9dce Minor fix. 2023-02-06 17:22:11 -05:00
Daniel Lemire
39e04ea766 We do not need a fallback. 2023-01-27 20:59:56 -05:00
Daniel Lemire
3e2da540ef Support rccpfastfloat. 2023-01-19 20:28:10 -05:00
Sergey Fedorov
ff7fba01d0
float_common.h: add support for ppc32 2023-01-18 14:15:14 +08:00
Daniel Lemire
c8aac4a63d Guard endian 2023-01-07 13:28:12 -05:00
Joao Paulo Magalhaes
7f7838b36a Fix compile warning: implicit double->float type conversion
With Intel 2021.1:
```
/home/runner/work/c4core/c4core/src/c4/ext/fast_float_all.h:319:49: error: implicit conversion between floating point types of different sizes [-Werror,-Wimplicit-float-size-conversion]
constexpr static float powers_of_ten_float[] = {1e0, 1e1, 1e2, 1e3,
1e4, 1e5,
```
2022-12-27 11:09:17 +00:00
Joao Paulo Magalhaes
ca13367ff7 Suppress warning when comparing floats 2022-12-27 01:39:41 +00:00
Daniel Lemire
102e74891f
Merge pull request #160 from huangqinjin/uint64-to-bool
Fix compile warning of unit64_t to bool
2022-12-23 10:39:33 -05:00
huangqinjin
293ca61c76 Fix compile warning of unit64_t to bool 2022-12-23 19:20:28 +08:00
huangqinjin
9c4c20dd7f Replace utf8 chars. 2022-12-18 11:04:16 +08:00
Sutou Kouhei
ff5855813f Add missing namespace end comments
Other files have it.
2022-12-02 11:42:38 +09:00