@@ -980,7 +980,7 @@ void _Assemble_floating_point_infinity(const bool _Is_negative, _FloatingType& _
980
980
_Uint_type _Sign_component = _Is_negative;
981
981
_Sign_component <<= _Floating_traits::_Sign_shift;
982
982
983
- const _Uint_type _Exponent_component = _Floating_traits::_Shifted_exponent_mask;
983
+ constexpr _Uint_type _Exponent_component = _Floating_traits::_Shifted_exponent_mask;
984
984
985
985
_Result = _Bit_cast<_FloatingType>(_Sign_component | _Exponent_component);
986
986
}
@@ -1227,12 +1227,12 @@ _NODISCARD errc _Assemble_floating_point_value_from_big_integer_flt(const _Big_i
1227
1227
_FloatingType& _Result) noexcept {
1228
1228
using _Traits = _Floating_type_traits<_FloatingType>;
1229
1229
1230
- const int32_t _Base_exponent = _Traits::_Mantissa_bits - 1;
1230
+ constexpr int32_t _Base_exponent = _Traits::_Mantissa_bits - 1;
1231
1231
1232
1232
// Very fast case: If we have 64 bits of precision or fewer,
1233
1233
// we can just take the two low order elements from the _Big_integer_flt:
1234
1234
if (_Integer_bits_of_precision <= 64) {
1235
- const int32_t _Exponent = _Base_exponent;
1235
+ constexpr int32_t _Exponent = _Base_exponent;
1236
1236
1237
1237
const uint32_t _Mantissa_low = _Integer_value._Myused > 0 ? _Integer_value._Mydata[0] : 0;
1238
1238
const uint32_t _Mantissa_high = _Integer_value._Myused > 1 ? _Integer_value._Mydata[1] : 0;
@@ -1335,7 +1335,7 @@ _NODISCARD errc _Convert_decimal_string_to_floating_type(
1335
1335
// To generate an N bit mantissa we require N + 1 bits of precision. The extra bit is used to correctly round
1336
1336
// the mantissa (if there are fewer bits than this available, then that's totally okay;
1337
1337
// in that case we use what we have and we don't need to round).
1338
- const uint32_t _Required_bits_of_precision = static_cast<uint32_t>(_Traits::_Mantissa_bits + 1);
1338
+ constexpr uint32_t _Required_bits_of_precision = static_cast<uint32_t>(_Traits::_Mantissa_bits + 1);
1339
1339
1340
1340
// The input is of the form 0.mantissa * 10^exponent, where 'mantissa' are the decimal digits of the mantissa
1341
1341
// and 'exponent' is the decimal exponent. We decompose the mantissa into two parts: an integer part and a
@@ -2167,7 +2167,7 @@ _NODISCARD to_chars_result _Floating_to_chars_hex_shortest(
2167
2167
// C11 7.21.6.1 "The fprintf function"/8: "If the value is zero, the exponent is zero."
2168
2168
// Special-casing zero is necessary because of the exponent.
2169
2169
const char* const _Str = "0p+0";
2170
- const size_t _Len = 4;
2170
+ constexpr size_t _Len = 4;
2171
2171
2172
2172
if (_Last - _First < static_cast<ptrdiff_t>(_Len)) {
2173
2173
return {_Last, errc::value_too_large};
0 commit comments