@@ -338,7 +338,7 @@ simple_decimal_conversion(const char *__restrict numStart,
338
338
// float, return inf.
339
339
if (hpd.get_decimal_point () > 0 &&
340
340
exp10_to_exp2 (hpd.get_decimal_point () - 1 ) > FloatProp::EXP_BIAS) {
341
- output.num = {0 , fputil::FPBits<T>::MAX_EXPONENT };
341
+ output.num = {0 , fputil::FPBits<T>::MAX_BIASED_EXPONENT };
342
342
output.error = ERANGE;
343
343
return output;
344
344
}
@@ -388,8 +388,8 @@ simple_decimal_conversion(const char *__restrict numStart,
388
388
exp2 += FloatProp::EXP_BIAS;
389
389
390
390
// Handle the exponent being too large (and return inf).
391
- if (exp2 >= FPBits::MAX_EXPONENT ) {
392
- output.num = {0 , FPBits::MAX_EXPONENT };
391
+ if (exp2 >= FPBits::MAX_BIASED_EXPONENT ) {
392
+ output.num = {0 , FPBits::MAX_BIASED_EXPONENT };
393
393
output.error = ERANGE;
394
394
return output;
395
395
}
@@ -424,7 +424,7 @@ simple_decimal_conversion(const char *__restrict numStart,
424
424
// Check if this rounding causes exp2 to go out of range and make the result
425
425
// INF. If this is the case, then finalMantissa and exp2 are already the
426
426
// correct values for an INF result.
427
- if (exp2 >= FPBits::MAX_EXPONENT ) {
427
+ if (exp2 >= FPBits::MAX_BIASED_EXPONENT ) {
428
428
output.error = ERANGE;
429
429
}
430
430
}
@@ -658,7 +658,7 @@ decimal_exp_to_float(ExpandedFloat<T> init_num, const char *__restrict numStart,
658
658
// float, return inf. These bounds are relatively loose, but are mostly
659
659
// serving as a first pass. Some close numbers getting through is okay.
660
660
if (exp10 > get_upper_bound<T>()) {
661
- output.num = {0 , FPBits::MAX_EXPONENT };
661
+ output.num = {0 , FPBits::MAX_BIASED_EXPONENT };
662
662
output.error = ERANGE;
663
663
return output;
664
664
}
@@ -920,10 +920,10 @@ decimal_string_to_float(const char *__restrict src, const char DECIMAL_POINT,
920
920
921
921
// If the result is in the valid range, then we use it. The valid range is
922
922
// also within the int32 range, so this prevents overflow issues.
923
- if (temp_exponent > FPBits::MAX_EXPONENT ) {
924
- exponent = FPBits::MAX_EXPONENT ;
925
- } else if (temp_exponent < -FPBits::MAX_EXPONENT ) {
926
- exponent = -FPBits::MAX_EXPONENT ;
923
+ if (temp_exponent > FPBits::MAX_BIASED_EXPONENT ) {
924
+ exponent = FPBits::MAX_BIASED_EXPONENT ;
925
+ } else if (temp_exponent < -FPBits::MAX_BIASED_EXPONENT ) {
926
+ exponent = -FPBits::MAX_BIASED_EXPONENT ;
927
927
} else {
928
928
exponent = static_cast <int32_t >(temp_exponent);
929
929
}
@@ -1034,10 +1034,10 @@ hexadecimal_string_to_float(const char *__restrict src,
1034
1034
1035
1035
// If the result is in the valid range, then we use it. The valid range is
1036
1036
// also within the int32 range, so this prevents overflow issues.
1037
- if (temp_exponent > FPBits::MAX_EXPONENT ) {
1038
- exponent = FPBits::MAX_EXPONENT ;
1039
- } else if (temp_exponent < -FPBits::MAX_EXPONENT ) {
1040
- exponent = -FPBits::MAX_EXPONENT ;
1037
+ if (temp_exponent > FPBits::MAX_BIASED_EXPONENT ) {
1038
+ exponent = FPBits::MAX_BIASED_EXPONENT ;
1039
+ } else if (temp_exponent < -FPBits::MAX_BIASED_EXPONENT ) {
1040
+ exponent = -FPBits::MAX_BIASED_EXPONENT ;
1041
1041
} else {
1042
1042
exponent = static_cast <int32_t >(temp_exponent);
1043
1043
}
0 commit comments