This commit is contained in:
IRainman 2026-04-30 15:39:27 +03:00
parent 482ce3b140
commit 71bd4e811f
3 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
// #define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
// #define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
// #define FASTFLOAT_ISNOT_CHECKED_BOUNDS
#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
#define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
#define FASTFLOAT_ISNOT_CHECKED_BOUNDS
#if defined(__linux__) || (__APPLE__ && __aarch64__)
#define USING_COUNTERS

View File

@ -1,7 +1,6 @@
#ifndef FASTFLOAT_DIGIT_COMPARISON_H
#define FASTFLOAT_DIGIT_COMPARISON_H
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <iterator>
@ -107,7 +106,7 @@ fastfloat_really_inline FASTFLOAT_CONSTEXPR14 void round(adjusted_mantissa &am,
if (-am.power2 >= mantissa_shift) {
// have a denormal float
am_pow_t shift = -am.power2 + 1;
cb(am, std::min<am_pow_t>(shift, 64));
cb(am, (shift < 64 ? shift : 64));
// check for round-up: if rounding-nearest carried us to the hidden bit.
am.power2 = (am.mantissa <
(am_mant_t(1) << binary_format<T>::mantissa_explicit_bits()))

View File

@ -440,7 +440,7 @@ fastfloat_strncasecmp(UC const *actual_mixedcase, UC const *expected_lowercase,
}
uint_fast8_t sz = 8 / (sizeof(UC));
for (uint_fast8_t i = 0; i < length; i += sz) {
sz = std::min(sz, static_cast<uint_fast8_t>(length - i));
sz = sz < (length - i) ? sz : length - i;
std::memcpy(&val1, actual_mixedcase + i, sz * sizeof(UC));
std::memcpy(&val2, expected_lowercase + i, sz * sizeof(UC));
val1 |= mask;