mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-06-15 00:16:11 +08:00
cleanup.
This commit is contained in:
parent
482ce3b140
commit
71bd4e811f
@ -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
|
||||
|
||||
@ -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()))
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user