[libc-commits] [libc] [libc][NFC] Rename MANTISSA_WIDTH in FRACTION_BITS (PR #75489)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Thu Dec 14 08:00:13 PST 2023


https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/75489

This one might be a bit controversial since the terminology has been introduced from the start but I think `FRACTION_BITS` is a better name here. AFAICT it really is "the number of bits after the decimal dot when the number is in normal form."

Mantissa width is less precise as it's unclear whether we take into account the hidden bit for IEEE754 formats.


>From 080c5f1860cc1f288f777ea89c55018b4733bc1f Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Thu, 14 Dec 2023 15:59:40 +0000
Subject: [PATCH] [libc][NFC] Rename MANTISSA_WIDTH in FRACTION_BITS

This one might be a bit controversial since the terminology has been introduced from the start but I think `FRACTION_BITS` is a better name here. AFAICT it really is "the number of bits after the decimal dot when the number is in normal form."

Mantissa width is less precise as it's unclear whether we take into account the hidden bit for IEEE754 formats.
---
 libc/src/__support/FPUtil/FPBits.h            | 24 ++++++-------
 libc/src/__support/FPUtil/FloatProperties.h   | 14 ++++----
 libc/src/__support/FPUtil/Hypot.h             |  8 ++---
 .../__support/FPUtil/ManipulationFunctions.h  |  2 +-
 .../FPUtil/NearestIntegerOperations.h         | 16 ++++-----
 libc/src/__support/FPUtil/NormalFloat.h       | 10 +++---
 libc/src/__support/FPUtil/dyadic_float.h      | 10 +++---
 libc/src/__support/FPUtil/fpbits_str.h        |  3 +-
 libc/src/__support/FPUtil/generic/FMA.h       |  8 ++---
 libc/src/__support/FPUtil/generic/FMod.h      |  2 +-
 libc/src/__support/FPUtil/generic/sqrt.h      |  6 ++--
 .../FPUtil/generic/sqrt_80_bit_long_double.h  |  6 ++--
 .../__support/FPUtil/x86_64/LongDoubleBits.h  | 28 +++++++--------
 .../FPUtil/x86_64/NextAfterLongDouble.h       | 17 +++++----
 libc/src/__support/float_to_string.h          | 18 +++++-----
 libc/src/__support/str_to_float.h             | 32 ++++++++---------
 libc/src/math/generic/asinf.cpp               |  2 +-
 libc/src/math/generic/erff.cpp                |  2 +-
 libc/src/math/generic/exp.cpp                 |  4 +--
 libc/src/math/generic/exp10.cpp               |  4 +--
 libc/src/math/generic/exp2.cpp                |  4 +--
 libc/src/math/generic/exp2f_impl.h            |  2 +-
 libc/src/math/generic/explogxf.h              | 16 ++++-----
 libc/src/math/generic/expm1.cpp               |  4 +--
 libc/src/math/generic/hypotf.cpp              |  2 +-
 libc/src/math/generic/log1p.cpp               | 17 +++++----
 libc/src/math/generic/log1pf.cpp              |  2 +-
 libc/src/math/generic/powf.cpp                | 20 +++++------
 libc/src/math/generic/range_reduction.h       |  2 +-
 libc/src/math/generic/sincosf.cpp             |  2 +-
 libc/src/math/generic/tanhf.cpp               |  2 +-
 .../stdio/printf_core/float_dec_converter.h   | 36 +++++++++----------
 .../stdio/printf_core/float_hex_converter.h   | 14 ++++----
 libc/test/src/math/FrexpTest.h                |  2 +-
 libc/test/src/math/LdExpTest.h                | 10 +++---
 libc/test/src/math/LogbTest.h                 |  2 +-
 libc/test/src/math/NextAfterTest.h            |  6 ++--
 libc/test/src/math/RoundToIntegerTest.h       |  2 +-
 libc/test/src/math/SqrtTest.h                 |  2 +-
 libc/test/src/math/smoke/FrexpTest.h          |  2 +-
 libc/test/src/math/smoke/LdExpTest.h          | 10 +++---
 libc/test/src/math/smoke/LogbTest.h           |  2 +-
 libc/test/src/math/smoke/NextAfterTest.h      |  6 ++--
 libc/test/src/math/smoke/NextTowardTest.h     |  6 ++--
 libc/test/src/math/smoke/SqrtTest.h           |  2 +-
 libc/utils/MPFRWrapper/MPFRUtils.cpp          |  6 ++--
 46 files changed, 193 insertions(+), 204 deletions(-)

diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h
index d1e26de22ef13..bbc006dc10eaa 100644
--- a/libc/src/__support/FPUtil/FPBits.h
+++ b/libc/src/__support/FPUtil/FPBits.h
@@ -37,8 +37,8 @@ template <typename T> struct FPBits : private FloatProperties<T> {
   using FloatProperties<T>::EXPONENT_MASK;
   using FloatProperties<T>::EXPONENT_BIAS;
   using FloatProperties<T>::EXPONENT_WIDTH;
-  using FloatProperties<T>::MANTISSA_MASK;
-  using FloatProperties<T>::MANTISSA_WIDTH;
+  using FloatProperties<T>::FRACTION_MASK;
+  using FloatProperties<T>::FRACTION_BITS;
   using FloatProperties<T>::QUIET_NAN_MASK;
   using FloatProperties<T>::SIGN_MASK;
 
@@ -48,32 +48,32 @@ template <typename T> struct FPBits : private FloatProperties<T> {
   UIntType bits;
 
   LIBC_INLINE constexpr void set_mantissa(UIntType mantVal) {
-    mantVal &= MANTISSA_MASK;
-    bits &= ~MANTISSA_MASK;
+    mantVal &= FRACTION_MASK;
+    bits &= ~FRACTION_MASK;
     bits |= mantVal;
   }
 
   LIBC_INLINE constexpr UIntType get_mantissa() const {
-    return bits & MANTISSA_MASK;
+    return bits & FRACTION_MASK;
   }
 
   LIBC_INLINE constexpr void set_biased_exponent(UIntType expVal) {
-    expVal = (expVal << MANTISSA_WIDTH) & EXPONENT_MASK;
+    expVal = (expVal << FRACTION_BITS) & EXPONENT_MASK;
     bits &= ~EXPONENT_MASK;
     bits |= expVal;
   }
 
   LIBC_INLINE constexpr uint16_t get_biased_exponent() const {
-    return uint16_t((bits & EXPONENT_MASK) >> MANTISSA_WIDTH);
+    return uint16_t((bits & EXPONENT_MASK) >> FRACTION_BITS);
   }
 
   // The function return mantissa with the implicit bit set iff the current
   // value is a valid normal number.
   LIBC_INLINE constexpr UIntType get_explicit_mantissa() {
     return ((get_biased_exponent() > 0 && !is_inf_or_nan())
-                ? (MANTISSA_MASK + 1)
+                ? (FRACTION_MASK + 1)
                 : 0) |
-           (MANTISSA_MASK & bits);
+           (FRACTION_MASK & bits);
   }
 
   LIBC_INLINE constexpr void set_sign(bool signVal) {
@@ -92,10 +92,10 @@ template <typename T> struct FPBits : private FloatProperties<T> {
   static constexpr int MAX_EXPONENT = (1 << EXPONENT_WIDTH) - 1;
 
   static constexpr UIntType MIN_SUBNORMAL = UIntType(1);
-  static constexpr UIntType MAX_SUBNORMAL = (UIntType(1) << MANTISSA_WIDTH) - 1;
-  static constexpr UIntType MIN_NORMAL = (UIntType(1) << MANTISSA_WIDTH);
+  static constexpr UIntType MAX_SUBNORMAL = FRACTION_MASK;
+  static constexpr UIntType MIN_NORMAL = (UIntType(1) << FRACTION_BITS);
   static constexpr UIntType MAX_NORMAL =
-      ((UIntType(MAX_EXPONENT) - 1) << MANTISSA_WIDTH) | MAX_SUBNORMAL;
+      ((UIntType(MAX_EXPONENT) - 1) << FRACTION_BITS) | MAX_SUBNORMAL;
 
   // We don't want accidental type promotions/conversions, so we require exact
   // type match.
diff --git a/libc/src/__support/FPUtil/FloatProperties.h b/libc/src/__support/FPUtil/FloatProperties.h
index 3f7dbdc5af342..9e301fc1cbbeb 100644
--- a/libc/src/__support/FPUtil/FloatProperties.h
+++ b/libc/src/__support/FPUtil/FloatProperties.h
@@ -152,18 +152,16 @@ struct FPProperties : public internal::FPBaseProperties<fp_type> {
           ? bit_at(SIG_BITS - 1) | bit_at(SIG_BITS - 3) // 0b1010...
           : bit_at(SIG_BITS - 2);                       // 0b0100...
 
-  // The number of bits after the decimal dot when the number if in normal form.
+public:
+  LIBC_INLINE_VAR static constexpr uint32_t BIT_WIDTH = TOTAL_BITS;
+  // The number of bits after the decimal dot when the number is in normal form.
   LIBC_INLINE_VAR static constexpr int FRACTION_BITS =
       UP::ENCODING == internal::FPEncoding::X86_ExtendedPrecision ? SIG_BITS - 1
                                                                   : SIG_BITS;
-
-public:
-  LIBC_INLINE_VAR static constexpr uint32_t BIT_WIDTH = TOTAL_BITS;
-  LIBC_INLINE_VAR static constexpr uint32_t MANTISSA_WIDTH = FRACTION_BITS;
   LIBC_INLINE_VAR static constexpr uint32_t MANTISSA_PRECISION =
-      MANTISSA_WIDTH + 1;
-  LIBC_INLINE_VAR static constexpr UIntType MANTISSA_MASK =
-      mask_trailing_ones<UIntType, MANTISSA_WIDTH>();
+      FRACTION_BITS + 1;
+  LIBC_INLINE_VAR static constexpr UIntType FRACTION_MASK =
+      mask_trailing_ones<UIntType, FRACTION_BITS>();
   LIBC_INLINE_VAR static constexpr uint32_t EXPONENT_WIDTH = EXP_BITS;
   LIBC_INLINE_VAR static constexpr int32_t EXPONENT_BIAS = EXP_BIAS;
   LIBC_INLINE_VAR static constexpr UIntType EXPONENT_MASK = EXP_MASK;
diff --git a/libc/src/__support/FPUtil/Hypot.h b/libc/src/__support/FPUtil/Hypot.h
index ad6b72db0524f..4d6b786b1b620 100644
--- a/libc/src/__support/FPUtil/Hypot.h
+++ b/libc/src/__support/FPUtil/Hypot.h
@@ -124,7 +124,7 @@ LIBC_INLINE T hypot(T x, T y) {
   uint16_t y_exp = y_bits.get_biased_exponent();
   uint16_t exp_diff = (x_exp > y_exp) ? (x_exp - y_exp) : (y_exp - x_exp);
 
-  if ((exp_diff >= FPBits_t::MANTISSA_WIDTH + 2) || (x == 0) || (y == 0)) {
+  if ((exp_diff >= FPBits_t::FRACTION_BITS + 2) || (x == 0) || (y == 0)) {
     return abs(x) + abs(y);
   }
 
@@ -148,7 +148,7 @@ LIBC_INLINE T hypot(T x, T y) {
   out_exp = a_exp;
 
   // Add an extra bit to simplify the final rounding bit computation.
-  constexpr UIntType ONE = UIntType(1) << (FPBits_t::MANTISSA_WIDTH + 1);
+  constexpr UIntType ONE = UIntType(1) << (FPBits_t::FRACTION_BITS + 1);
 
   a_mant <<= 1;
   b_mant <<= 1;
@@ -158,7 +158,7 @@ LIBC_INLINE T hypot(T x, T y) {
   if (a_exp != 0) {
     leading_one = ONE;
     a_mant |= ONE;
-    y_mant_width = FPBits_t::MANTISSA_WIDTH + 1;
+    y_mant_width = FPBits_t::FRACTION_BITS + 1;
   } else {
     leading_one = internal::find_leading_one(a_mant, y_mant_width);
     a_exp = 1;
@@ -258,7 +258,7 @@ LIBC_INLINE T hypot(T x, T y) {
     }
   }
 
-  y_new |= static_cast<UIntType>(out_exp) << FPBits_t::MANTISSA_WIDTH;
+  y_new |= static_cast<UIntType>(out_exp) << FPBits_t::FRACTION_BITS;
   return cpp::bit_cast<T>(y_new);
 }
 
diff --git a/libc/src/__support/FPUtil/ManipulationFunctions.h b/libc/src/__support/FPUtil/ManipulationFunctions.h
index 51b58ba29bab8..2f22fa2d5baa3 100644
--- a/libc/src/__support/FPUtil/ManipulationFunctions.h
+++ b/libc/src/__support/FPUtil/ManipulationFunctions.h
@@ -130,7 +130,7 @@ LIBC_INLINE T ldexp(T x, int exp) {
   // early. Because the result of the ldexp operation can be a subnormal number,
   // we need to accommodate the (mantissaWidht + 1) worth of shift in
   // calculating the limit.
-  int exp_limit = FPBits<T>::MAX_EXPONENT + FPBits<T>::MANTISSA_WIDTH + 1;
+  int exp_limit = FPBits<T>::MAX_EXPONENT + FPBits<T>::FRACTION_BITS + 1;
   if (exp > exp_limit)
     return bits.get_sign() ? T(FPBits<T>::neg_inf()) : T(FPBits<T>::inf());
 
diff --git a/libc/src/__support/FPUtil/NearestIntegerOperations.h b/libc/src/__support/FPUtil/NearestIntegerOperations.h
index b0ae8d0040ea1..37bdaca7c2515 100644
--- a/libc/src/__support/FPUtil/NearestIntegerOperations.h
+++ b/libc/src/__support/FPUtil/NearestIntegerOperations.h
@@ -36,7 +36,7 @@ LIBC_INLINE T trunc(T x) {
 
   // If the exponent is greater than the most negative mantissa
   // exponent, then x is already an integer.
-  if (exponent >= static_cast<int>(FPBits<T>::MANTISSA_WIDTH))
+  if (exponent >= static_cast<int>(FPBits<T>::FRACTION_BITS))
     return x;
 
   // If the exponent is such that abs(x) is less than 1, then return 0.
@@ -47,7 +47,7 @@ LIBC_INLINE T trunc(T x) {
       return T(0.0);
   }
 
-  int trim_size = FPBits<T>::MANTISSA_WIDTH - exponent;
+  int trim_size = FPBits<T>::FRACTION_BITS - exponent;
   bits.set_mantissa((bits.get_mantissa() >> trim_size) << trim_size);
   return T(bits);
 }
@@ -65,7 +65,7 @@ LIBC_INLINE T ceil(T x) {
 
   // If the exponent is greater than the most negative mantissa
   // exponent, then x is already an integer.
-  if (exponent >= static_cast<int>(FPBits<T>::MANTISSA_WIDTH))
+  if (exponent >= static_cast<int>(FPBits<T>::FRACTION_BITS))
     return x;
 
   if (exponent <= -1) {
@@ -75,7 +75,7 @@ LIBC_INLINE T ceil(T x) {
       return T(1.0);
   }
 
-  uint32_t trim_size = FPBits<T>::MANTISSA_WIDTH - exponent;
+  uint32_t trim_size = FPBits<T>::FRACTION_BITS - exponent;
   bits.set_mantissa((bits.get_mantissa() >> trim_size) << trim_size);
   T trunc_value = T(bits);
 
@@ -114,7 +114,7 @@ LIBC_INLINE T round(T x) {
 
   // If the exponent is greater than the most negative mantissa
   // exponent, then x is already an integer.
-  if (exponent >= static_cast<int>(FPBits<T>::MANTISSA_WIDTH))
+  if (exponent >= static_cast<int>(FPBits<T>::FRACTION_BITS))
     return x;
 
   if (exponent == -1) {
@@ -133,7 +133,7 @@ LIBC_INLINE T round(T x) {
       return T(0.0);
   }
 
-  uint32_t trim_size = FPBits<T>::MANTISSA_WIDTH - exponent;
+  uint32_t trim_size = FPBits<T>::FRACTION_BITS - exponent;
   bool half_bit_set =
       bool(bits.get_mantissa() & (UIntType(1) << (trim_size - 1)));
   bits.set_mantissa((bits.get_mantissa() >> trim_size) << trim_size);
@@ -167,7 +167,7 @@ LIBC_INLINE T round_using_current_rounding_mode(T x) {
 
   // If the exponent is greater than the most negative mantissa
   // exponent, then x is already an integer.
-  if (exponent >= static_cast<int>(FPBits<T>::MANTISSA_WIDTH))
+  if (exponent >= static_cast<int>(FPBits<T>::FRACTION_BITS))
     return x;
 
   if (exponent <= -1) {
@@ -188,7 +188,7 @@ LIBC_INLINE T round_using_current_rounding_mode(T x) {
     }
   }
 
-  uint32_t trim_size = FPBits<T>::MANTISSA_WIDTH - exponent;
+  uint32_t trim_size = FPBits<T>::FRACTION_BITS - exponent;
   FPBits<T> new_bits = bits;
   new_bits.set_mantissa((bits.get_mantissa() >> trim_size) << trim_size);
   T trunc_value = T(new_bits);
diff --git a/libc/src/__support/FPUtil/NormalFloat.h b/libc/src/__support/FPUtil/NormalFloat.h
index 397a3bb41673b..32ce0e2ab1299 100644
--- a/libc/src/__support/FPUtil/NormalFloat.h
+++ b/libc/src/__support/FPUtil/NormalFloat.h
@@ -32,7 +32,7 @@ template <typename T> struct NormalFloat {
       "NormalFloat template parameter has to be a floating point type.");
 
   using UIntType = typename FPBits<T>::UIntType;
-  static constexpr UIntType ONE = (UIntType(1) << FPBits<T>::MANTISSA_WIDTH);
+  static constexpr UIntType ONE = (UIntType(1) << FPBits<T>::FRACTION_BITS);
 
   // Unbiased exponent value.
   int32_t exponent;
@@ -40,7 +40,7 @@ template <typename T> struct NormalFloat {
   UIntType mantissa;
   // We want |UIntType| to have atleast one bit more than the actual mantissa
   // bit width to accommodate the implicit 1 value.
-  static_assert(sizeof(UIntType) * 8 >= FPBits<T>::MANTISSA_WIDTH + 1,
+  static_assert(sizeof(UIntType) * 8 >= FPBits<T>::FRACTION_BITS + 1,
                 "Bad type for mantissa in NormalFloat.");
 
   bool sign;
@@ -105,7 +105,7 @@ template <typename T> struct NormalFloat {
       unsigned shift = SUBNORMAL_EXPONENT - exponent;
       // Since exponent > subnormalExponent, shift is strictly greater than
       // zero.
-      if (shift <= FPBits<T>::MANTISSA_WIDTH + 1) {
+      if (shift <= FPBits<T>::FRACTION_BITS + 1) {
         // Generate a subnormal number. Might lead to loss of precision.
         // We round to nearest and round halfway cases to even.
         const UIntType shift_out_mask = (UIntType(1) << shift) - 1;
@@ -163,7 +163,7 @@ template <typename T> struct NormalFloat {
 
   LIBC_INLINE unsigned evaluate_normalization_shift(UIntType m) {
     unsigned shift = 0;
-    for (; (ONE & m) == 0 && (shift < FPBits<T>::MANTISSA_WIDTH);
+    for (; (ONE & m) == 0 && (shift < FPBits<T>::FRACTION_BITS);
          m <<= 1, ++shift)
       ;
     return shift;
@@ -222,7 +222,7 @@ template <> LIBC_INLINE NormalFloat<long double>::operator long double() const {
   constexpr int SUBNORMAL_EXPONENT = -LDBits::EXPONENT_BIAS + 1;
   if (exponent < SUBNORMAL_EXPONENT) {
     unsigned shift = SUBNORMAL_EXPONENT - exponent;
-    if (shift <= LDBits::MANTISSA_WIDTH + 1) {
+    if (shift <= LDBits::FRACTION_BITS + 1) {
       // Generate a subnormal number. Might lead to loss of precision.
       // We round to nearest and round halfway cases to even.
       const UIntType shift_out_mask = (UIntType(1) << shift) - 1;
diff --git a/libc/src/__support/FPUtil/dyadic_float.h b/libc/src/__support/FPUtil/dyadic_float.h
index 5f0d8f49ccf64..da926e78003c0 100644
--- a/libc/src/__support/FPUtil/dyadic_float.h
+++ b/libc/src/__support/FPUtil/dyadic_float.h
@@ -42,10 +42,10 @@ template <size_t Bits> struct DyadicFloat {
 
   template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
   DyadicFloat(T x) {
-    static_assert(FloatProperties<T>::MANTISSA_WIDTH < Bits);
+    static_assert(FloatProperties<T>::FRACTION_BITS < Bits);
     FPBits<T> x_bits(x);
     sign = x_bits.get_sign();
-    exponent = x_bits.get_exponent() - FloatProperties<T>::MANTISSA_WIDTH;
+    exponent = x_bits.get_exponent() - FloatProperties<T>::FRACTION_BITS;
     mantissa = MantissaType(x_bits.get_explicit_mantissa());
     normalize();
   }
@@ -86,7 +86,7 @@ template <size_t Bits> struct DyadicFloat {
   // TODO(lntue): Test or add specialization for x86 long double.
   template <typename T, typename = cpp::enable_if_t<
                             cpp::is_floating_point_v<T> &&
-                                (FloatProperties<T>::MANTISSA_WIDTH < Bits),
+                                (FloatProperties<T>::FRACTION_BITS < Bits),
                             void>>
   explicit operator T() const {
     // TODO(lntue): Do we need to treat signed zeros properly?
@@ -116,7 +116,7 @@ template <size_t Bits> struct DyadicFloat {
 
     T d_hi = FPBits<T>::create_value(sign, exp_hi,
                                      static_cast<output_bits_t>(m_hi) &
-                                         FloatProperties<T>::MANTISSA_MASK)
+                                         FloatProperties<T>::FRACTION_MASK)
                  .get_val();
 
     const MantissaType round_mask = MantissaType(1) << (shift - 1);
@@ -157,7 +157,7 @@ template <size_t Bits> struct DyadicFloat {
     if (LIBC_UNLIKELY(denorm)) {
       // Output is denormal, simply clear the exponent field.
       output_bits_t clear_exp = output_bits_t(exp_hi)
-                                << FloatProperties<T>::MANTISSA_WIDTH;
+                                << FloatProperties<T>::FRACTION_BITS;
       output_bits_t r_bits = FPBits<T>(r).uintval() - clear_exp;
       return FPBits<T>(r_bits).get_val();
     }
diff --git a/libc/src/__support/FPUtil/fpbits_str.h b/libc/src/__support/FPUtil/fpbits_str.h
index 5d0bb6cf1ac4d..f23988cc3a680 100644
--- a/libc/src/__support/FPUtil/fpbits_str.h
+++ b/libc/src/__support/FPUtil/fpbits_str.h
@@ -56,8 +56,7 @@ template <typename T> LIBC_INLINE cpp::string str(fputil::FPBits<T> x) {
   const details::ZeroPaddedHexFmt<uint16_t> exponent(x.get_biased_exponent());
   s += exponent.view();
 
-  if constexpr (cpp::is_same_v<T, long double> &&
-                fputil::FloatProperties<long double>::MANTISSA_WIDTH == 63) {
+  if constexpr (fputil::get_fp_type<T>() == fputil::FPType::X86_Binary80) {
     s += ", I: ";
     s += sign_char(x.get_implicit_bit());
   }
diff --git a/libc/src/__support/FPUtil/generic/FMA.h b/libc/src/__support/FPUtil/generic/FMA.h
index 3c4d943a7c71f..7aed3168ace5a 100644
--- a/libc/src/__support/FPUtil/generic/FMA.h
+++ b/libc/src/__support/FPUtil/generic/FMA.h
@@ -159,10 +159,10 @@ template <> LIBC_INLINE double fma<double>(double x, double y, double z) {
 
   UInt128 prod_mant = x_mant * y_mant << 10;
   int prod_lsb_exp =
-      x_exp + y_exp - (FPBits::EXPONENT_BIAS + 2 * FPBits::MANTISSA_WIDTH + 10);
+      x_exp + y_exp - (FPBits::EXPONENT_BIAS + 2 * FPBits::FRACTION_BITS + 10);
 
   z_mant <<= 64;
-  int z_lsb_exp = z_exp - (FPBits::MANTISSA_WIDTH + 64);
+  int z_lsb_exp = z_exp - (FPBits::FRACTION_BITS + 64);
   bool round_bit = false;
   bool sticky_bits = false;
   bool z_shifted = false;
@@ -268,8 +268,8 @@ template <> LIBC_INLINE double fma<double>(double x, double y, double z) {
   }
 
   // Remove hidden bit and append the exponent field and sign bit.
-  result = (result & FloatProp::MANTISSA_MASK) |
-           (static_cast<uint64_t>(r_exp) << FloatProp::MANTISSA_WIDTH);
+  result = (result & FloatProp::FRACTION_MASK) |
+           (static_cast<uint64_t>(r_exp) << FloatProp::FRACTION_BITS);
   if (prod_sign) {
     result |= FloatProp::SIGN_MASK;
   }
diff --git a/libc/src/__support/FPUtil/generic/FMod.h b/libc/src/__support/FPUtil/generic/FMod.h
index f30586f9d7f34..7f2e9c41ca194 100644
--- a/libc/src/__support/FPUtil/generic/FMod.h
+++ b/libc/src/__support/FPUtil/generic/FMod.h
@@ -236,7 +236,7 @@ class FMod {
     int e_y = sy.get_biased_exponent();
 
     // Most common case where |y| is "very normal" and |x/y| < 2^EXPONENT_WIDTH
-    if (LIBC_LIKELY(e_y > int(FPB::MANTISSA_WIDTH) &&
+    if (LIBC_LIKELY(e_y > int(FPB::FRACTION_BITS) &&
                     e_x - e_y <= int(FPB::EXPONENT_WIDTH))) {
       UIntType m_x = sx.get_explicit_mantissa();
       UIntType m_y = sy.get_explicit_mantissa();
diff --git a/libc/src/__support/FPUtil/generic/sqrt.h b/libc/src/__support/FPUtil/generic/sqrt.h
index cd5ec58bcdbd5..bafea6595506f 100644
--- a/libc/src/__support/FPUtil/generic/sqrt.h
+++ b/libc/src/__support/FPUtil/generic/sqrt.h
@@ -37,7 +37,7 @@ template <typename T>
 LIBC_INLINE void normalize(int &exponent,
                            typename FPBits<T>::UIntType &mantissa) {
   const int shift = cpp::countl_zero(mantissa) -
-                    (8 * sizeof(mantissa) - 1 - FPBits<T>::MANTISSA_WIDTH);
+                    (8 * sizeof(mantissa) - 1 - FPBits<T>::FRACTION_BITS);
   exponent -= shift;
   mantissa <<= shift;
 }
@@ -72,7 +72,7 @@ LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, T> sqrt(T x) {
   } else {
     // IEEE floating points formats.
     using UIntType = typename FPBits<T>::UIntType;
-    constexpr UIntType ONE = UIntType(1) << FPBits<T>::MANTISSA_WIDTH;
+    constexpr UIntType ONE = UIntType(1) << FPBits<T>::FRACTION_BITS;
 
     FPBits<T> bits(x);
 
@@ -148,7 +148,7 @@ LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, T> sqrt(T x) {
       x_exp = ((x_exp >> 1) + FPBits<T>::EXPONENT_BIAS);
 
       y = (y - ONE) |
-          (static_cast<UIntType>(x_exp) << FPBits<T>::MANTISSA_WIDTH);
+          (static_cast<UIntType>(x_exp) << FPBits<T>::FRACTION_BITS);
 
       switch (quick_get_round()) {
       case FE_TONEAREST:
diff --git a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
index 46ca796aeb4b6..c1309f3657354 100644
--- a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
+++ b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
@@ -23,7 +23,7 @@ namespace x86 {
 LIBC_INLINE void normalize(int &exponent, UInt128 &mantissa) {
   const unsigned int shift = static_cast<unsigned int>(
       cpp::countl_zero(static_cast<uint64_t>(mantissa)) -
-      (8 * sizeof(uint64_t) - 1 - FPBits<long double>::MANTISSA_WIDTH));
+      (8 * sizeof(uint64_t) - 1 - FPBits<long double>::FRACTION_BITS));
   exponent -= shift;
   mantissa <<= shift;
 }
@@ -38,7 +38,7 @@ LIBC_INLINE long double sqrt(long double x);
 LIBC_INLINE long double sqrt(long double x) {
   using LDBits = FPBits<long double>;
   using UIntType = typename LDBits::UIntType;
-  constexpr UIntType ONE = UIntType(1) << int(LDBits::MANTISSA_WIDTH);
+  constexpr UIntType ONE = UIntType(1) << int(LDBits::FRACTION_BITS);
 
   FPBits<long double> bits(x);
 
@@ -111,7 +111,7 @@ LIBC_INLINE long double sqrt(long double x) {
 
     // Append the exponent field.
     x_exp = ((x_exp >> 1) + LDBits::EXPONENT_BIAS);
-    y |= (static_cast<UIntType>(x_exp) << (LDBits::MANTISSA_WIDTH + 1));
+    y |= (static_cast<UIntType>(x_exp) << (LDBits::FRACTION_BITS + 1));
 
     switch (quick_get_round()) {
     case FE_TONEAREST:
diff --git a/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h b/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
index a31667528be2b..e64c9dad04739 100644
--- a/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
+++ b/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
@@ -33,37 +33,37 @@ template <> struct FPBits<long double> : private FloatProperties<long double> {
   using FloatProperties<long double>::EXPONENT_MASK;
   using FloatProperties<long double>::EXPONENT_BIAS;
   using FloatProperties<long double>::EXPONENT_WIDTH;
-  using FloatProperties<long double>::MANTISSA_MASK;
-  using FloatProperties<long double>::MANTISSA_WIDTH;
+  using FloatProperties<long double>::FRACTION_MASK;
+  using FloatProperties<long double>::FRACTION_BITS;
   using FloatProperties<long double>::QUIET_NAN_MASK;
   using FloatProperties<long double>::SIGN_MASK;
 
   static constexpr int MAX_EXPONENT = 0x7FFF;
   static constexpr UIntType MIN_SUBNORMAL = UIntType(1);
   // Subnormal numbers include the implicit bit in x86 long double formats.
-  static constexpr UIntType MAX_SUBNORMAL = (UIntType(1) << MANTISSA_WIDTH) - 1;
-  static constexpr UIntType MIN_NORMAL = (UIntType(3) << MANTISSA_WIDTH);
+  static constexpr UIntType MAX_SUBNORMAL = (UIntType(1) << FRACTION_BITS) - 1;
+  static constexpr UIntType MIN_NORMAL = (UIntType(3) << FRACTION_BITS);
   static constexpr UIntType MAX_NORMAL =
-      (UIntType(MAX_EXPONENT - 1) << (MANTISSA_WIDTH + 1)) |
-      (UIntType(1) << MANTISSA_WIDTH) | MAX_SUBNORMAL;
+      (UIntType(MAX_EXPONENT - 1) << (FRACTION_BITS + 1)) |
+      (UIntType(1) << FRACTION_BITS) | MAX_SUBNORMAL;
 
   UIntType bits;
 
   LIBC_INLINE constexpr void set_mantissa(UIntType mantVal) {
-    mantVal &= MANTISSA_MASK;
-    bits &= ~MANTISSA_MASK;
+    mantVal &= FRACTION_MASK;
+    bits &= ~FRACTION_MASK;
     bits |= mantVal;
   }
 
   LIBC_INLINE constexpr UIntType get_mantissa() const {
-    return bits & MANTISSA_MASK;
+    return bits & FRACTION_MASK;
   }
 
   LIBC_INLINE constexpr UIntType get_explicit_mantissa() const {
     // The x86 80 bit float represents the leading digit of the mantissa
     // explicitly. This is the mask for that bit.
-    constexpr UIntType EXPLICIT_BIT_MASK = UIntType(1) << MANTISSA_WIDTH;
-    return bits & (MANTISSA_MASK | EXPLICIT_BIT_MASK);
+    constexpr UIntType EXPLICIT_BIT_MASK = UIntType(1) << FRACTION_BITS;
+    return bits & (FRACTION_MASK | EXPLICIT_BIT_MASK);
   }
 
   LIBC_INLINE constexpr void set_biased_exponent(UIntType expVal) {
@@ -77,12 +77,12 @@ template <> struct FPBits<long double> : private FloatProperties<long double> {
   }
 
   LIBC_INLINE constexpr void set_implicit_bit(bool implicitVal) {
-    bits &= ~(UIntType(1) << MANTISSA_WIDTH);
-    bits |= (UIntType(implicitVal) << MANTISSA_WIDTH);
+    bits &= ~(UIntType(1) << FRACTION_BITS);
+    bits |= (UIntType(implicitVal) << FRACTION_BITS);
   }
 
   LIBC_INLINE constexpr bool get_implicit_bit() const {
-    return bool((bits & (UIntType(1) << MANTISSA_WIDTH)) >> MANTISSA_WIDTH);
+    return bool((bits & (UIntType(1) << FRACTION_BITS)) >> FRACTION_BITS);
   }
 
   LIBC_INLINE constexpr void set_sign(bool signVal) {
diff --git a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
index 653b6a48f3cc5..55788e5ae2944 100644
--- a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
+++ b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
@@ -45,8 +45,7 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
 
   using UIntType = FPBits::UIntType;
   constexpr UIntType SIGN_VAL = (UIntType(1) << 79);
-  constexpr UIntType MANTISSA_MASK =
-      (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1;
+  constexpr UIntType FRACTION_MASK = FPBits::FRACTION_MASK;
   UIntType int_val = from_bits.uintval();
   if (from < 0.0l) {
     if (from > to) {
@@ -54,7 +53,7 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
         // We deal with normal/subnormal boundary separately to avoid
         // dealing with the implicit bit.
         int_val = SIGN_VAL + FPBits::MIN_NORMAL;
-      } else if ((int_val & MANTISSA_MASK) == MANTISSA_MASK) {
+      } else if ((int_val & FRACTION_MASK) == FRACTION_MASK) {
         from_bits.set_mantissa(0);
         // Incrementing exponent might overflow the value to infinity,
         // which is what is expected. Since NaNs are handling separately,
@@ -71,8 +70,8 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
         // We deal with normal/subnormal boundary separately to avoid
         // dealing with the implicit bit.
         int_val = SIGN_VAL + FPBits::MAX_SUBNORMAL;
-      } else if ((int_val & MANTISSA_MASK) == 0) {
-        from_bits.set_mantissa(MANTISSA_MASK);
+      } else if ((int_val & FRACTION_MASK) == 0) {
+        from_bits.set_mantissa(FRACTION_MASK);
         // from == 0 is handled separately so decrementing the exponent will not
         // lead to underflow.
         from_bits.set_biased_exponent(from_bits.get_biased_exponent() - 1);
@@ -90,8 +89,8 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
     if (from > to) {
       if (int_val == FPBits::MIN_NORMAL) {
         int_val = FPBits::MAX_SUBNORMAL;
-      } else if ((int_val & MANTISSA_MASK) == 0) {
-        from_bits.set_mantissa(MANTISSA_MASK);
+      } else if ((int_val & FRACTION_MASK) == 0) {
+        from_bits.set_mantissa(FRACTION_MASK);
         // from == 0 is handled separately so decrementing the exponent will not
         // lead to underflow.
         from_bits.set_biased_exponent(from_bits.get_biased_exponent() - 1);
@@ -102,7 +101,7 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
     } else {
       if (int_val == FPBits::MAX_SUBNORMAL) {
         int_val = FPBits::MIN_NORMAL;
-      } else if ((int_val & MANTISSA_MASK) == MANTISSA_MASK) {
+      } else if ((int_val & FRACTION_MASK) == FRACTION_MASK) {
         from_bits.set_mantissa(0);
         // Incrementing exponent might overflow the value to infinity,
         // which is what is expected. Since NaNs are handling separately,
@@ -117,7 +116,7 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
     }
   }
 
-  UIntType implicit_bit = int_val & (UIntType(1) << FPBits::MANTISSA_WIDTH);
+  UIntType implicit_bit = int_val & (UIntType(1) << FPBits::FRACTION_BITS);
   if (implicit_bit == UIntType(0))
     raise_except_if_required(FE_UNDERFLOW | FE_INEXACT);
 
diff --git a/libc/src/__support/float_to_string.h b/libc/src/__support/float_to_string.h
index d53bb4b4c62b1..36a9b8565650b 100644
--- a/libc/src/__support/float_to_string.h
+++ b/libc/src/__support/float_to_string.h
@@ -416,7 +416,7 @@ class FloatToString {
   int exponent;
   FloatProp::UIntType mantissa;
 
-  static constexpr int MANT_WIDTH = fputil::FPBits<T>::MANTISSA_WIDTH;
+  static constexpr int FRACTION_BITS = fputil::FPBits<T>::FRACTION_BITS;
   static constexpr int EXP_BIAS = fputil::FPBits<T>::EXPONENT_BIAS;
 
 public:
@@ -426,7 +426,7 @@ class FloatToString {
     mantissa = float_bits.get_explicit_mantissa();
 
     // Adjust for the width of the mantissa.
-    exponent -= MANT_WIDTH;
+    exponent -= FRACTION_BITS;
 
     // init_convert();
   }
@@ -440,7 +440,7 @@ class FloatToString {
   // get_block returns an integer that represents the digits in the requested
   // block.
   LIBC_INLINE constexpr BlockInt get_positive_block(int block_index) {
-    if (exponent >= -MANT_WIDTH) {
+    if (exponent >= -FRACTION_BITS) {
       // idx is ceil(exponent/16) or 0 if exponent is negative. This is used to
       // find the coarse section of the POW10_SPLIT table that will be used to
       // calculate the 9 digit window, as well as some other related values.
@@ -567,12 +567,13 @@ class FloatToString {
   }
 
   LIBC_INLINE constexpr size_t get_positive_blocks() {
-    if (exponent >= -MANT_WIDTH) {
+    if (exponent >= -FRACTION_BITS) {
       const uint32_t idx =
           exponent < 0
               ? 0
               : static_cast<uint32_t>(exponent + (IDX_SIZE - 1)) / IDX_SIZE;
-      const uint32_t len = internal::length_for_num(idx * IDX_SIZE, MANT_WIDTH);
+      const uint32_t len =
+          internal::length_for_num(idx * IDX_SIZE, FRACTION_BITS);
       return len;
     } else {
       return 0;
@@ -608,12 +609,13 @@ class FloatToString {
 
 template <>
 LIBC_INLINE constexpr size_t FloatToString<long double>::get_positive_blocks() {
-  if (exponent >= -MANT_WIDTH) {
+  if (exponent >= -FRACTION_BITS) {
     const uint32_t idx =
         exponent < 0
             ? 0
             : static_cast<uint32_t>(exponent + (IDX_SIZE - 1)) / IDX_SIZE;
-    const uint32_t len = internal::length_for_num(idx * IDX_SIZE, MANT_WIDTH);
+    const uint32_t len =
+        internal::length_for_num(idx * IDX_SIZE, FRACTION_BITS);
     return len;
   } else {
     return 0;
@@ -639,7 +641,7 @@ LIBC_INLINE constexpr bool FloatToString<long double>::is_lowest_block(size_t) {
 template <>
 LIBC_INLINE constexpr BlockInt
 FloatToString<long double>::get_positive_block(int block_index) {
-  if (exponent >= -MANT_WIDTH) {
+  if (exponent >= -FRACTION_BITS) {
 
     // idx is ceil(exponent/16) or 0 if exponent is negative. This is used to
     // find the coarse section of the POW10_SPLIT table that will be used to
diff --git a/libc/src/__support/str_to_float.h b/libc/src/__support/str_to_float.h
index 3807d3ff57216..41b658015c07f 100644
--- a/libc/src/__support/str_to_float.h
+++ b/libc/src/__support/str_to_float.h
@@ -111,7 +111,7 @@ eisel_lemire(ExpandedFloat<T> init_num,
   // it's 6 bits for floats in this case.
   const uint64_t halfway_constant =
       (uint64_t(1) << (FloatProp::UINTTYPE_BITS -
-                       (FloatProp::MANTISSA_WIDTH + 3))) -
+                       (FloatProp::FRACTION_BITS + 3))) -
       1;
   if ((high64(first_approx) & halfway_constant) == halfway_constant &&
       low64(first_approx) + mantissa < mantissa) {
@@ -135,7 +135,7 @@ eisel_lemire(ExpandedFloat<T> init_num,
                                        (FloatProp::UINTTYPE_BITS - 1));
   UIntType final_mantissa = static_cast<UIntType>(
       high64(final_approx) >>
-      (msb + FloatProp::UINTTYPE_BITS - (FloatProp::MANTISSA_WIDTH + 3)));
+      (msb + FloatProp::UINTTYPE_BITS - (FloatProp::FRACTION_BITS + 3)));
   exp2 -= static_cast<uint32_t>(1 ^ msb); // same as !msb
 
   if (round == RoundDirection::Nearest) {
@@ -161,7 +161,7 @@ eisel_lemire(ExpandedFloat<T> init_num,
 
   // From 54 to 53 bits for doubles and 25 to 24 bits for floats
   final_mantissa >>= 1;
-  if ((final_mantissa >> (FloatProp::MANTISSA_WIDTH + 1)) > 0) {
+  if ((final_mantissa >> (FloatProp::FRACTION_BITS + 1)) > 0) {
     final_mantissa >>= 1;
     ++exp2;
   }
@@ -248,7 +248,7 @@ eisel_lemire<long double>(ExpandedFloat<long double> init_num,
   // it's 12 bits for 128 bit floats in this case.
   constexpr UInt128 HALFWAY_CONSTANT =
       (UInt128(1) << (FloatProp::UINTTYPE_BITS -
-                      (FloatProp::MANTISSA_WIDTH + 3))) -
+                      (FloatProp::FRACTION_BITS + 3))) -
       1;
 
   if ((final_approx_upper & HALFWAY_CONSTANT) == HALFWAY_CONSTANT &&
@@ -261,7 +261,7 @@ eisel_lemire<long double>(ExpandedFloat<long double> init_num,
                                        (FloatProp::UINTTYPE_BITS - 1));
   UIntType final_mantissa =
       final_approx_upper >>
-      (msb + FloatProp::UINTTYPE_BITS - (FloatProp::MANTISSA_WIDTH + 3));
+      (msb + FloatProp::UINTTYPE_BITS - (FloatProp::FRACTION_BITS + 3));
   exp2 -= static_cast<uint32_t>(1 ^ msb); // same as !msb
 
   if (round == RoundDirection::Nearest) {
@@ -286,7 +286,7 @@ eisel_lemire<long double>(ExpandedFloat<long double> init_num,
   // From 65 to 64 bits for 80 bit floats and 113  to 112 bits for 128 bit
   // floats
   final_mantissa >>= 1;
-  if ((final_mantissa >> (FloatProp::MANTISSA_WIDTH + 1)) > 0) {
+  if ((final_mantissa >> (FloatProp::FRACTION_BITS + 1)) > 0) {
     final_mantissa >>= 1;
     ++exp2;
   }
@@ -347,7 +347,7 @@ simple_decimal_conversion(const char *__restrict numStart,
   if (hpd.get_decimal_point() < 0 &&
       exp10_to_exp2(-hpd.get_decimal_point()) >
           (FloatProp::EXPONENT_BIAS +
-           static_cast<int32_t>(FloatProp::MANTISSA_WIDTH))) {
+           static_cast<int32_t>(FloatProp::FRACTION_BITS))) {
     output.num = {0, 0};
     output.error = ERANGE;
     return output;
@@ -396,7 +396,7 @@ simple_decimal_conversion(const char *__restrict numStart,
   }
 
   // Shift left to fill the mantissa
-  hpd.shift(FloatProp::MANTISSA_WIDTH);
+  hpd.shift(FloatProp::FRACTION_BITS);
   UIntType final_mantissa = hpd.round_to_integer_type<UIntType>();
 
   // Handle subnormals
@@ -412,13 +412,13 @@ simple_decimal_conversion(const char *__restrict numStart,
     final_mantissa = hpd.round_to_integer_type<UIntType>(round);
 
     // Check if by shifting right we've caused this to round to a normal number.
-    if ((final_mantissa >> FloatProp::MANTISSA_WIDTH) != 0) {
+    if ((final_mantissa >> FloatProp::FRACTION_BITS) != 0) {
       ++exp2;
     }
   }
 
   // Check if rounding added a bit, and shift down if that's the case.
-  if (final_mantissa == UIntType(2) << FloatProp::MANTISSA_WIDTH) {
+  if (final_mantissa == UIntType(2) << FloatProp::FRACTION_BITS) {
     final_mantissa >>= 1;
     ++exp2;
 
@@ -522,7 +522,7 @@ clinger_fast_path(ExpandedFloat<T> init_num,
   UIntType mantissa = init_num.mantissa;
   int32_t exp10 = init_num.exponent;
 
-  if ((mantissa >> FloatProp::MANTISSA_WIDTH) > 0) {
+  if ((mantissa >> FloatProp::FRACTION_BITS) > 0) {
     return cpp::nullopt;
   }
 
@@ -624,7 +624,7 @@ template <> constexpr int32_t get_upper_bound<double>() { return 309; }
 template <typename T> constexpr int32_t get_lower_bound() {
   using FloatProp = typename fputil::FloatProperties<T>;
   return -((FloatProp::EXPONENT_BIAS +
-            static_cast<int32_t>(FloatProp::MANTISSA_WIDTH +
+            static_cast<int32_t>(FloatProp::FRACTION_BITS +
                                  FloatProp::UINTTYPE_BITS)) /
            3);
 }
@@ -756,7 +756,7 @@ LIBC_INLINE FloatConvertReturn<T> binary_exp_to_float(ExpandedFloat<T> init_num,
   }
 
   uint32_t amount_to_shift_right =
-      FloatProp::UINTTYPE_BITS - FloatProp::MANTISSA_WIDTH - 1;
+      FloatProp::UINTTYPE_BITS - FloatProp::FRACTION_BITS - 1;
 
   // Handle subnormals.
   if (biased_exponent <= 0) {
@@ -779,7 +779,7 @@ LIBC_INLINE FloatConvertReturn<T> binary_exp_to_float(ExpandedFloat<T> init_num,
   if (amount_to_shift_right < FloatProp::UINTTYPE_BITS) {
     // Shift the mantissa and clear the implicit bit.
     mantissa >>= amount_to_shift_right;
-    mantissa &= FloatProp::MANTISSA_MASK;
+    mantissa &= FloatProp::FRACTION_MASK;
   } else {
     mantissa = 0;
   }
@@ -802,7 +802,7 @@ LIBC_INLINE FloatConvertReturn<T> binary_exp_to_float(ExpandedFloat<T> init_num,
     }
   }
 
-  if (mantissa > FloatProp::MANTISSA_MASK) {
+  if (mantissa > FloatProp::FRACTION_MASK) {
     // Rounding causes the exponent to increase.
     ++biased_exponent;
 
@@ -815,7 +815,7 @@ LIBC_INLINE FloatConvertReturn<T> binary_exp_to_float(ExpandedFloat<T> init_num,
     output.error = ERANGE;
   }
 
-  output.num = {mantissa & FloatProp::MANTISSA_MASK, biased_exponent};
+  output.num = {mantissa & FloatProp::FRACTION_MASK, biased_exponent};
   return output;
 }
 
diff --git a/libc/src/math/generic/asinf.cpp b/libc/src/math/generic/asinf.cpp
index 5406e6660d784..51eefe984b677 100644
--- a/libc/src/math/generic/asinf.cpp
+++ b/libc/src/math/generic/asinf.cpp
@@ -108,7 +108,7 @@ LLVM_LIBC_FUNCTION(float, asinf, (float x)) {
       fputil::set_errno_if_required(EDOM);
       fputil::raise_except_if_required(FE_INVALID);
     }
-    return x + FPBits::build_nan(1 << (FPBits::MANTISSA_WIDTH - 1));
+    return x + FPBits::build_nan(FPBits::FRACTION_MASK);
   }
 
   // Check for exceptional values
diff --git a/libc/src/math/generic/erff.cpp b/libc/src/math/generic/erff.cpp
index d63fb8e31384d..bbf0d0423b799 100644
--- a/libc/src/math/generic/erff.cpp
+++ b/libc/src/math/generic/erff.cpp
@@ -154,7 +154,7 @@ LLVM_LIBC_FUNCTION(float, erff, (float x)) {
   double xd = static_cast<double>(x);
   double xsq = xd * xd;
 
-  const uint32_t EIGHT = 3 << FPBits::MANTISSA_WIDTH;
+  const uint32_t EIGHT = 3 << FPBits::FRACTION_BITS;
   int idx = static_cast<int>(FPBits(x_abs + EIGHT).get_val());
 
   double x4 = xsq * xsq;
diff --git a/libc/src/math/generic/exp.cpp b/libc/src/math/generic/exp.cpp
index b3f645fb0939b..5f0b724abe9ba 100644
--- a/libc/src/math/generic/exp.cpp
+++ b/libc/src/math/generic/exp.cpp
@@ -382,7 +382,7 @@ LLVM_LIBC_FUNCTION(double, exp, (double x)) {
     if (LIBC_LIKELY(upper == lower)) {
       // to multiply by 2^hi, a fast way is to simply add hi to the exponent
       // field.
-      int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+      int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
       double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper));
       return r;
     }
@@ -400,7 +400,7 @@ LLVM_LIBC_FUNCTION(double, exp, (double x)) {
     double lower_dd = r_dd.hi + (r_dd.lo - ERR_DD);
 
     if (LIBC_LIKELY(upper_dd == lower_dd)) {
-      int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+      int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
       double r =
           cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper_dd));
       return r;
diff --git a/libc/src/math/generic/exp10.cpp b/libc/src/math/generic/exp10.cpp
index b152425b14b59..5b2c55c73a068 100644
--- a/libc/src/math/generic/exp10.cpp
+++ b/libc/src/math/generic/exp10.cpp
@@ -395,7 +395,7 @@ LLVM_LIBC_FUNCTION(double, exp10, (double x)) {
   if (LIBC_LIKELY(upper == lower)) {
     // To multiply by 2^hi, a fast way is to simply add hi to the exponent
     // field.
-    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
     double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper));
     return r;
   }
@@ -462,7 +462,7 @@ LLVM_LIBC_FUNCTION(double, exp10, (double x)) {
   if (LIBC_LIKELY(upper_dd == lower_dd)) {
     // To multiply by 2^hi, a fast way is to simply add hi to the exponent
     // field.
-    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
     double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper_dd));
     return r;
   }
diff --git a/libc/src/math/generic/exp2.cpp b/libc/src/math/generic/exp2.cpp
index b4b9960ccb2fb..6c707de076d0a 100644
--- a/libc/src/math/generic/exp2.cpp
+++ b/libc/src/math/generic/exp2.cpp
@@ -362,7 +362,7 @@ LLVM_LIBC_FUNCTION(double, exp2, (double x)) {
   if (LIBC_LIKELY(upper == lower)) {
     // To multiply by 2^hi, a fast way is to simply add hi to the exponent
     // field.
-    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
     double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper));
     return r;
   }
@@ -376,7 +376,7 @@ LLVM_LIBC_FUNCTION(double, exp2, (double x)) {
   if (LIBC_LIKELY(upper_dd == lower_dd)) {
     // To multiply by 2^hi, a fast way is to simply add hi to the exponent
     // field.
-    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
     double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper_dd));
     return r;
   }
diff --git a/libc/src/math/generic/exp2f_impl.h b/libc/src/math/generic/exp2f_impl.h
index 961fb16977eb8..9bb5c7362d3e8 100644
--- a/libc/src/math/generic/exp2f_impl.h
+++ b/libc/src/math/generic/exp2f_impl.h
@@ -137,7 +137,7 @@ LIBC_INLINE float exp2f(float x) {
   // exp_hi = shift hi to the exponent field of double precision.
   int64_t exp_hi =
       static_cast<int64_t>(static_cast<uint64_t>(k >> ExpBase::MID_BITS)
-                           << fputil::FloatProperties<double>::MANTISSA_WIDTH);
+                           << fputil::FloatProperties<double>::FRACTION_BITS);
   // mh = 2^hi * 2^mid
   // mh_bits = bit field of mh
   int64_t mh_bits = ExpBase::EXP_2_MID[k & ExpBase::MID_MASK] + exp_hi;
diff --git a/libc/src/math/generic/explogxf.h b/libc/src/math/generic/explogxf.h
index 3dae5af068b4b..92bd66af92c89 100644
--- a/libc/src/math/generic/explogxf.h
+++ b/libc/src/math/generic/explogxf.h
@@ -162,7 +162,7 @@ template <class Base> LIBC_INLINE exp_b_reduc_t exp_b_range_reduc(float x) {
   // hi = floor(kd * 2^(-MID_BITS))
   // exp_hi = shift hi to the exponent field of double precision.
   int64_t exp_hi = static_cast<int64_t>((k >> Base::MID_BITS))
-                   << fputil::FloatProperties<double>::MANTISSA_WIDTH;
+                   << fputil::FloatProperties<double>::FRACTION_BITS;
   // mh = 2^hi * 2^mid
   // mh_bits = bit field of mh
   int64_t mh_bits = Base::EXP_2_MID[k & Base::MID_MASK] + exp_hi;
@@ -235,9 +235,9 @@ template <bool is_sinh> LIBC_INLINE double exp_pm_eval(float x) {
   // hi = floor(kf * 2^(-5))
   // exp_hi = shift hi to the exponent field of double precision.
   int64_t exp_hi_p = static_cast<int64_t>((k_p >> ExpBase::MID_BITS))
-                     << fputil::FloatProperties<double>::MANTISSA_WIDTH;
+                     << fputil::FloatProperties<double>::FRACTION_BITS;
   int64_t exp_hi_m = static_cast<int64_t>((k_m >> ExpBase::MID_BITS))
-                     << fputil::FloatProperties<double>::MANTISSA_WIDTH;
+                     << fputil::FloatProperties<double>::FRACTION_BITS;
   // mh_p = 2^(hi + mid)
   // mh_m = 2^(-(hi + mid))
   // mh_bits_* = bit field of mh_*
@@ -280,10 +280,10 @@ LIBC_INLINE static double log2_eval(double x) {
   double result = 0;
   result += bs.get_exponent();
 
-  int p1 = (bs.get_mantissa() >> (FPB::MANTISSA_WIDTH - LOG_P1_BITS)) &
+  int p1 = (bs.get_mantissa() >> (FPB::FRACTION_BITS - LOG_P1_BITS)) &
            (LOG_P1_SIZE - 1);
 
-  bs.bits &= FPB::MANTISSA_MASK >> LOG_P1_BITS;
+  bs.bits &= FPB::FRACTION_MASK >> LOG_P1_BITS;
   bs.set_biased_exponent(FPB::EXPONENT_BIAS);
   double dx = (bs.get_val() - 1.0) * LOG_P1_1_OVER[p1];
 
@@ -310,10 +310,10 @@ LIBC_INLINE static double log_eval(double x) {
 
   // p1 is the leading 7 bits of mx, i.e.
   // p1 * 2^(-7) <= m_x < (p1 + 1) * 2^(-7).
-  int p1 = static_cast<int>(bs.get_mantissa() >> (FPB::MANTISSA_WIDTH - 7));
+  int p1 = static_cast<int>(bs.get_mantissa() >> (FPB::FRACTION_BITS - 7));
 
   // Set bs to (1 + (mx - p1*2^(-7))
-  bs.bits &= FPB::MANTISSA_MASK >> 7;
+  bs.bits &= FPB::FRACTION_MASK >> 7;
   bs.set_biased_exponent(FPB::EXPONENT_BIAS);
   // dx = (mx - p1*2^(-7)) / (1 + p1*2^(-7)).
   double dx = (bs.get_val() - 1.0) * ONE_OVER_F[p1];
@@ -345,7 +345,7 @@ LIBC_INLINE cpp::optional<double> ziv_test_denorm(int hi, double mid, double lo,
   using FloatProp = typename fputil::FloatProperties<double>;
 
   // Scaling factor = 1/(min normal number) = 2^1022
-  int64_t exp_hi = static_cast<int64_t>(hi + 1022) << FloatProp::MANTISSA_WIDTH;
+  int64_t exp_hi = static_cast<int64_t>(hi + 1022) << FloatProp::FRACTION_BITS;
   double mid_hi = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(mid));
   double lo_scaled =
       (lo != 0.0) ? cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(lo))
diff --git a/libc/src/math/generic/expm1.cpp b/libc/src/math/generic/expm1.cpp
index e751395481534..634caa56cb0ff 100644
--- a/libc/src/math/generic/expm1.cpp
+++ b/libc/src/math/generic/expm1.cpp
@@ -465,7 +465,7 @@ LLVM_LIBC_FUNCTION(double, expm1, (double x)) {
   if (LIBC_LIKELY(upper == lower)) {
     // to multiply by 2^hi, a fast way is to simply add hi to the exponent
     // field.
-    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
     double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper));
     return r;
   }
@@ -479,7 +479,7 @@ LLVM_LIBC_FUNCTION(double, expm1, (double x)) {
   double lower_dd = r_dd.hi + (r_dd.lo - err_dd);
 
   if (LIBC_LIKELY(upper_dd == lower_dd)) {
-    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::MANTISSA_WIDTH;
+    int64_t exp_hi = static_cast<int64_t>(hi) << FloatProp::FRACTION_BITS;
     double r = cpp::bit_cast<double>(exp_hi + cpp::bit_cast<int64_t>(upper_dd));
     return r;
   }
diff --git a/libc/src/math/generic/hypotf.cpp b/libc/src/math/generic/hypotf.cpp
index 5795291a043ae..ec7e95961790b 100644
--- a/libc/src/math/generic/hypotf.cpp
+++ b/libc/src/math/generic/hypotf.cpp
@@ -23,7 +23,7 @@ LLVM_LIBC_FUNCTION(float, hypotf, (float x, float y)) {
   uint16_t y_exp = y_bits.get_biased_exponent();
   uint16_t exp_diff = (x_exp > y_exp) ? (x_exp - y_exp) : (y_exp - x_exp);
 
-  if (exp_diff >= FPBits::MANTISSA_WIDTH + 2) {
+  if (exp_diff >= FPBits::FRACTION_BITS + 2) {
     return fputil::abs(x) + fputil::abs(y);
   }
 
diff --git a/libc/src/math/generic/log1p.cpp b/libc/src/math/generic/log1p.cpp
index 757f2793cb9cf..2fc5bc7c71e3a 100644
--- a/libc/src/math/generic/log1p.cpp
+++ b/libc/src/math/generic/log1p.cpp
@@ -873,8 +873,8 @@ LIBC_INLINE double log1p_accurate(int e_x, int index,
 LLVM_LIBC_FUNCTION(double, log1p, (double x)) {
   using FPBits_t = typename fputil::FPBits<double>;
   constexpr int EXPONENT_BIAS = FPBits_t::EXPONENT_BIAS;
-  constexpr int MANTISSA_WIDTH = FPBits_t::MANTISSA_WIDTH;
-  constexpr uint64_t MANTISSA_MASK = FPBits_t::MANTISSA_MASK;
+  constexpr int FRACTION_BITS = FPBits_t::FRACTION_BITS;
+  constexpr uint64_t FRACTION_MASK = FPBits_t::FRACTION_MASK;
   FPBits_t xbits(x);
   uint64_t x_u = xbits.uintval();
 
@@ -910,7 +910,7 @@ LLVM_LIBC_FUNCTION(double, log1p, (double x)) {
   } else {
     // |x| < 1
     if (LIBC_UNLIKELY(xbits.get_biased_exponent() <
-                      EXPONENT_BIAS - MANTISSA_WIDTH - 1)) {
+                      EXPONENT_BIAS - FRACTION_BITS - 1)) {
       // Quick return when |x| < 2^-53.
       // Since log(1 + x) = x - x^2/2 + x^3/3 - ...,
       // for |x| < 2^-53,
@@ -950,8 +950,8 @@ LLVM_LIBC_FUNCTION(double, log1p, (double x)) {
   // Range reduction:
   // Find k such that |x_hi - k * 2^-7| <= 2^-8.
   int idx = static_cast<int>(
-      ((x_u & MANTISSA_MASK) + (1ULL << (MANTISSA_WIDTH - 8))) >>
-      (MANTISSA_WIDTH - 7));
+      ((x_u & FRACTION_MASK) + (1ULL << (FRACTION_BITS - 8))) >>
+      (FRACTION_BITS - 7));
   int x_e = xhi_bits.get_exponent() + (idx >> 7);
   double e_x = static_cast<double>(x_e);
 
@@ -967,9 +967,8 @@ LLVM_LIBC_FUNCTION(double, log1p, (double x)) {
   double err_hi = ERR_HI[hi == 0.0];
 
   // Scaling factior = 2^(-xh_bits.get_exponent())
-  uint64_t s_u =
-      (static_cast<uint64_t>(EXPONENT_BIAS) << (MANTISSA_WIDTH + 1)) -
-      (x_u & FPBits_t::EXPONENT_MASK);
+  uint64_t s_u = (static_cast<uint64_t>(EXPONENT_BIAS) << (FRACTION_BITS + 1)) -
+                 (x_u & FPBits_t::EXPONENT_MASK);
   // When the exponent of x is 2^1023, its inverse, 2^(-1023), is subnormal.
   const double EXPONENT_CORRECTION[2] = {0.0, 0x1.0p-1023};
   double scaling = FPBits_t(s_u).get_val() + EXPONENT_CORRECTION[s_u == 0];
@@ -999,7 +998,7 @@ LLVM_LIBC_FUNCTION(double, log1p, (double x)) {
   v_hi = fputil::multiply_add(r, m_dd.hi, -1.0); // Exact.
 #else
   // c = 1 + idx * 2^-7.
-  double c = FPBits_t((static_cast<uint64_t>(idx) << (MANTISSA_WIDTH - 7)) +
+  double c = FPBits_t((static_cast<uint64_t>(idx) << (FRACTION_BITS - 7)) +
                       uint64_t(0x3FF0'0000'0000'0000ULL))
                  .get_val();
   v_hi = fputil::multiply_add(r, m_dd.hi - c, RCM1[idx]); // Exact
diff --git a/libc/src/math/generic/log1pf.cpp b/libc/src/math/generic/log1pf.cpp
index fabd2bdc31bf3..8078aaf490cc2 100644
--- a/libc/src/math/generic/log1pf.cpp
+++ b/libc/src/math/generic/log1pf.cpp
@@ -57,7 +57,7 @@ LIBC_INLINE float log(double x) {
   // Get the 8 highest bits, use 7 bits (excluding the implicit hidden bit) for
   // lookup tables.
   int f_index = static_cast<int>(xbits.get_mantissa() >>
-                                 (fputil::FPBits<double>::MANTISSA_WIDTH - 7));
+                                 (fputil::FPBits<double>::FRACTION_BITS - 7));
 
   // Set bits to 1.m
   xbits.set_biased_exponent(0x3FF);
diff --git a/libc/src/math/generic/powf.cpp b/libc/src/math/generic/powf.cpp
index efc866618ef21..99d6bb25d1980 100644
--- a/libc/src/math/generic/powf.cpp
+++ b/libc/src/math/generic/powf.cpp
@@ -390,11 +390,10 @@ LIBC_INLINE bool is_odd_integer(float x) {
   using FloatProp = typename fputil::FloatProperties<float>;
   uint32_t x_u = cpp::bit_cast<uint32_t>(x);
   int32_t x_e = static_cast<int32_t>((x_u & FloatProp::EXPONENT_MASK) >>
-                                     FloatProp::MANTISSA_WIDTH);
+                                     FloatProp::FRACTION_BITS);
   int32_t lsb = cpp::countr_zero(x_u | FloatProp::EXPONENT_MASK);
   constexpr int32_t UNIT_EXPONENT =
-      FloatProp::EXPONENT_BIAS +
-      static_cast<int32_t>(FloatProp::MANTISSA_WIDTH);
+      FloatProp::EXPONENT_BIAS + static_cast<int32_t>(FloatProp::FRACTION_BITS);
   return (x_e + lsb == UNIT_EXPONENT);
 }
 
@@ -402,11 +401,10 @@ LIBC_INLINE bool is_integer(float x) {
   using FloatProp = typename fputil::FloatProperties<float>;
   uint32_t x_u = cpp::bit_cast<uint32_t>(x);
   int32_t x_e = static_cast<int32_t>((x_u & FloatProp::EXPONENT_MASK) >>
-                                     FloatProp::MANTISSA_WIDTH);
+                                     FloatProp::FRACTION_BITS);
   int32_t lsb = cpp::countr_zero(x_u | FloatProp::EXPONENT_MASK);
   constexpr int32_t UNIT_EXPONENT =
-      FloatProp::EXPONENT_BIAS +
-      static_cast<int32_t>(FloatProp::MANTISSA_WIDTH);
+      FloatProp::EXPONENT_BIAS + static_cast<int32_t>(FloatProp::FRACTION_BITS);
   return (x_e + lsb >= UNIT_EXPONENT);
 }
 
@@ -502,7 +500,7 @@ double powf_double_double(int idx_x, double dx, double y6, double lo6_hi,
     bool lo_sign = DoubleBits(r.lo).get_sign();
     if (hi_sign == lo_sign) {
       ++r_bits;
-    } else if ((r_bits & DoubleProp::MANTISSA_MASK) > 0) {
+    } else if ((r_bits & DoubleProp::FRACTION_MASK) > 0) {
       --r_bits;
     }
   }
@@ -671,11 +669,11 @@ LLVM_LIBC_FUNCTION(float, powf, (float x, float y)) {
   x_u = FloatBits(x).uintval();
 
   // Extract exponent field of x.
-  ex += (x_u >> FloatProp::MANTISSA_WIDTH);
+  ex += (x_u >> FloatProp::FRACTION_BITS);
   double e_x = static_cast<double>(ex);
   // Use the highest 7 fractional bits of m_x as the index for look up tables.
-  uint32_t x_mant = x_u & FloatProp::MANTISSA_MASK;
-  int idx_x = static_cast<int>(x_mant >> (FloatProp::MANTISSA_WIDTH - 7));
+  uint32_t x_mant = x_u & FloatProp::FRACTION_MASK;
+  int idx_x = static_cast<int>(x_mant >> (FloatProp::FRACTION_BITS - 7));
   // Add the hidden bit to the mantissa.
   // 1 <= m_x < 2
   float m_x = cpp::bit_cast<float>(x_mant | 0x3f800000);
@@ -776,7 +774,7 @@ LLVM_LIBC_FUNCTION(float, powf, (float x, float y)) {
   int idx_y = hm_i & 0x3f;
 
   // 2^hi
-  int64_t exp_hi_i = (hm_i >> 6) << DoubleProp::MANTISSA_WIDTH;
+  int64_t exp_hi_i = (hm_i >> 6) << DoubleProp::FRACTION_BITS;
   // 2^mid
   int64_t exp_mid_i = cpp::bit_cast<uint64_t>(EXP2_MID1[idx_y].hi);
   // (-1)^sign * 2^hi * 2^mid
diff --git a/libc/src/math/generic/range_reduction.h b/libc/src/math/generic/range_reduction.h
index 551f2457ecb8e..836161e803cbf 100644
--- a/libc/src/math/generic/range_reduction.h
+++ b/libc/src/math/generic/range_reduction.h
@@ -59,7 +59,7 @@ LIBC_INLINE int64_t small_range_reduction(double x, double &y) {
 LIBC_INLINE int64_t large_range_reduction(double x, int x_exp, double &y) {
   int idx = 0;
   y = 0;
-  int x_lsb_exp_m4 = x_exp - fputil::FloatProperties<float>::MANTISSA_WIDTH;
+  int x_lsb_exp_m4 = x_exp - fputil::FloatProperties<float>::FRACTION_BITS;
 
   // Skipping the first parts of 32/pi such that:
   //   LSB of x * LSB of THIRTYTWO_OVER_PI_28[i] >= 32.
diff --git a/libc/src/math/generic/sincosf.cpp b/libc/src/math/generic/sincosf.cpp
index c5694fd1bea58..44371db710871 100644
--- a/libc/src/math/generic/sincosf.cpp
+++ b/libc/src/math/generic/sincosf.cpp
@@ -148,7 +148,7 @@ LLVM_LIBC_FUNCTION(void, sincosf, (float x, float *sinp, float *cosp)) {
       fputil::set_errno_if_required(EDOM);
       fputil::raise_except_if_required(FE_INVALID);
     }
-    *sinp = x + FPBits::build_nan(1 << (FPBits::MANTISSA_WIDTH - 1));
+    *sinp = x + FPBits::build_nan(FPBits::FRACTION_MASK);
     *cosp = *sinp;
     return;
   }
diff --git a/libc/src/math/generic/tanhf.cpp b/libc/src/math/generic/tanhf.cpp
index a0046d3dabc62..3b388232ae4ee 100644
--- a/libc/src/math/generic/tanhf.cpp
+++ b/libc/src/math/generic/tanhf.cpp
@@ -90,7 +90,7 @@ LLVM_LIBC_FUNCTION(float, tanhf, (float x)) {
   // -hi = floor(-k * 2^(-MID_BITS))
   // exp_mhi = shift -hi to the exponent field of double precision.
   int64_t exp_mhi = static_cast<int64_t>(mk >> ExpBase::MID_BITS)
-                    << fputil::FloatProperties<double>::MANTISSA_WIDTH;
+                    << fputil::FloatProperties<double>::FRACTION_BITS;
   // mh = 2^(-hi - mid)
   int64_t mh_bits = ExpBase::EXP_2_MID[mk & ExpBase::MID_MASK] + exp_mhi;
   double mh = fputil::FPBits<double>(uint64_t(mh_bits)).get_val();
diff --git a/libc/src/stdio/printf_core/float_dec_converter.h b/libc/src/stdio/printf_core/float_dec_converter.h
index 98b573646f7c3..fc6395feb97e2 100644
--- a/libc/src/stdio/printf_core/float_dec_converter.h
+++ b/libc/src/stdio/printf_core/float_dec_converter.h
@@ -477,8 +477,8 @@ template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
 LIBC_INLINE int convert_float_decimal_typed(Writer *writer,
                                             const FormatSection &to_conv,
                                             fputil::FPBits<T> float_bits) {
-  // signed because later we use -MANT_WIDTH
-  constexpr int32_t MANT_WIDTH = fputil::FloatProperties<T>::MANTISSA_WIDTH;
+  // signed because later we use -FRACTION_BITS
+  constexpr int32_t FRACTION_BITS = fputil::FloatProperties<T>::FRACTION_BITS;
   bool is_negative = float_bits.get_sign();
   int exponent = float_bits.get_explicit_exponent();
 
@@ -536,7 +536,7 @@ LIBC_INLINE int convert_float_decimal_typed(Writer *writer,
     float_writer.write_first_block(0);
   }
 
-  if (exponent < MANT_WIDTH) {
+  if (exponent < FRACTION_BITS) {
     const uint32_t blocks = (precision / static_cast<uint32_t>(BLOCK_SIZE)) + 1;
     uint32_t i = 0;
     // if all the blocks we should write are zero
@@ -569,9 +569,9 @@ LIBC_INLINE int convert_float_decimal_typed(Writer *writer,
           digits /= 10;
         }
         RoundDirection round;
-        const bool truncated =
-            !zero_after_digits(exponent - MANT_WIDTH, precision,
-                               float_bits.get_explicit_mantissa(), MANT_WIDTH);
+        const bool truncated = !zero_after_digits(
+            exponent - FRACTION_BITS, precision,
+            float_bits.get_explicit_mantissa(), FRACTION_BITS);
         round = get_round_direction(last_digit, truncated, is_negative);
 
         RET_IF_RESULT_NEGATIVE(
@@ -590,8 +590,8 @@ template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
 LIBC_INLINE int convert_float_dec_exp_typed(Writer *writer,
                                             const FormatSection &to_conv,
                                             fputil::FPBits<T> float_bits) {
-  // signed because later we use -MANT_WIDTH
-  constexpr int32_t MANT_WIDTH = fputil::FloatProperties<T>::MANTISSA_WIDTH;
+  // signed because later we use -FRACTION_BITS
+  constexpr int32_t FRACTION_BITS = fputil::FloatProperties<T>::FRACTION_BITS;
   bool is_negative = float_bits.get_sign();
   int exponent = float_bits.get_explicit_exponent();
   MantissaInt mantissa = float_bits.get_explicit_mantissa();
@@ -733,11 +733,11 @@ LIBC_INLINE int convert_float_dec_exp_typed(Writer *writer,
       }
     }
     // If it's still not truncated and there are digits below the decimal point
-    if (!truncated && exponent - MANT_WIDTH < 0) {
+    if (!truncated && exponent - FRACTION_BITS < 0) {
       // Use the formula from %f.
-      truncated =
-          !zero_after_digits(exponent - MANT_WIDTH, precision - final_exponent,
-                             float_bits.get_explicit_mantissa(), MANT_WIDTH);
+      truncated = !zero_after_digits(
+          exponent - FRACTION_BITS, precision - final_exponent,
+          float_bits.get_explicit_mantissa(), FRACTION_BITS);
     }
   }
   round = get_round_direction(last_digit, truncated, is_negative);
@@ -753,8 +753,8 @@ template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
 LIBC_INLINE int convert_float_dec_auto_typed(Writer *writer,
                                              const FormatSection &to_conv,
                                              fputil::FPBits<T> float_bits) {
-  // signed because later we use -MANT_WIDTH
-  constexpr int32_t MANT_WIDTH = fputil::FloatProperties<T>::MANTISSA_WIDTH;
+  // signed because later we use -FRACTION_BITS
+  constexpr int32_t FRACTION_BITS = fputil::FloatProperties<T>::FRACTION_BITS;
   bool is_negative = float_bits.get_sign();
   int exponent = float_bits.get_explicit_exponent();
   MantissaInt mantissa = float_bits.get_explicit_mantissa();
@@ -980,11 +980,11 @@ LIBC_INLINE int convert_float_dec_auto_typed(Writer *writer,
       }
     }
     // If it's still not truncated and there are digits below the decimal point
-    if (!truncated && exponent - MANT_WIDTH < 0) {
+    if (!truncated && exponent - FRACTION_BITS < 0) {
       // Use the formula from %f.
-      truncated =
-          !zero_after_digits(exponent - MANT_WIDTH, exp_precision - base_10_exp,
-                             float_bits.get_explicit_mantissa(), MANT_WIDTH);
+      truncated = !zero_after_digits(
+          exponent - FRACTION_BITS, exp_precision - base_10_exp,
+          float_bits.get_explicit_mantissa(), FRACTION_BITS);
     }
   }
 
diff --git a/libc/src/stdio/printf_core/float_hex_converter.h b/libc/src/stdio/printf_core/float_hex_converter.h
index cb10e219388be..aae6ee417f72e 100644
--- a/libc/src/stdio/printf_core/float_hex_converter.h
+++ b/libc/src/stdio/printf_core/float_hex_converter.h
@@ -38,9 +38,9 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer,
   int exponent;
   MantissaInt mantissa;
   bool is_inf_or_nan;
-  uint32_t mantissa_width;
+  uint32_t fraction_bits;
   if (to_conv.length_modifier == LengthModifier::L) {
-    mantissa_width = LDBits::MANTISSA_WIDTH;
+    fraction_bits = LDBits::FRACTION_BITS;
     LDBits::UIntType float_raw = to_conv.conv_val_raw;
     LDBits float_bits(float_raw);
     is_negative = float_bits.get_sign();
@@ -49,7 +49,7 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer,
     is_inf_or_nan = float_bits.is_inf_or_nan();
   } else {
     using LBits = fputil::FPBits<double>;
-    mantissa_width = LBits::MANTISSA_WIDTH;
+    fraction_bits = LBits::FRACTION_BITS;
     LBits::UIntType float_raw =
         static_cast<LBits::UIntType>(to_conv.conv_val_raw);
     LBits float_bits(float_raw);
@@ -78,8 +78,8 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer,
   // digits. This is primarily relevant for x86 80 bit long doubles, which have
   // 63 bit mantissas. In the case where the mantissa is 0, however, the
   // exponent should stay as 0.
-  if (mantissa_width % BITS_IN_HEX_DIGIT != 0 && mantissa > 0) {
-    exponent -= mantissa_width % BITS_IN_HEX_DIGIT;
+  if (fraction_bits % BITS_IN_HEX_DIGIT != 0 && mantissa > 0) {
+    exponent -= fraction_bits % BITS_IN_HEX_DIGIT;
   }
 
   // This is the max number of digits it can take to represent the mantissa.
@@ -87,10 +87,10 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer,
   // for the extra implicit bit. We use the larger of the two possible values
   // since the size must be constant.
   constexpr size_t MANT_BUFF_LEN =
-      (LDBits::MANTISSA_WIDTH / BITS_IN_HEX_DIGIT) + 1;
+      (LDBits::FRACTION_BITS / BITS_IN_HEX_DIGIT) + 1;
   char mant_buffer[MANT_BUFF_LEN];
 
-  size_t mant_len = (mantissa_width / BITS_IN_HEX_DIGIT) + 1;
+  size_t mant_len = (fraction_bits / BITS_IN_HEX_DIGIT) + 1;
 
   // Precision only tracks the number of digits after the hexadecimal point, so
   // we have to add one to account for the digit before the hexadecimal point.
diff --git a/libc/test/src/math/FrexpTest.h b/libc/test/src/math/FrexpTest.h
index 2f93987b1ea75..ffe743b32aab4 100644
--- a/libc/test/src/math/FrexpTest.h
+++ b/libc/test/src/math/FrexpTest.h
@@ -20,7 +20,7 @@ template <typename T> class FrexpTest : public LIBC_NAMESPACE::testing::Test {
   DECLARE_SPECIAL_CONSTANTS(T)
 
   static constexpr UIntType HIDDEN_BIT =
-      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::MANTISSA_WIDTH;
+      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::FRACTION_BITS;
 
 public:
   typedef T (*FrexpFunc)(T, int *);
diff --git a/libc/test/src/math/LdExpTest.h b/libc/test/src/math/LdExpTest.h
index 5ebba62a3dbb8..5b1e242d81440 100644
--- a/libc/test/src/math/LdExpTest.h
+++ b/libc/test/src/math/LdExpTest.h
@@ -23,7 +23,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
   using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
   using NormalFloat = LIBC_NAMESPACE::fputil::NormalFloat<T>;
   using UIntType = typename FPBits::UIntType;
-  static constexpr UIntType MANTISSA_WIDTH = FPBits::MANTISSA_WIDTH;
+  static constexpr UIntType FRACTION_BITS = FPBits::FRACTION_BITS;
   // A normalized mantissa to be used with tests.
   static constexpr UIntType MANTISSA = NormalFloat::ONE + 0x1234;
 
@@ -69,7 +69,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
   void testUnderflowToZeroOnNormal(LdExpFunc func) {
     // In this test, we pass a normal nubmer to func and expect zero
     // to be returned due to underflow.
-    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(MANTISSA_WIDTH);
+    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(FRACTION_BITS);
     int32_t exp_array[] = {base_exponent + 5, base_exponent + 4,
                            base_exponent + 3, base_exponent + 2,
                            base_exponent + 1};
@@ -82,7 +82,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
   void testUnderflowToZeroOnSubnormal(LdExpFunc func) {
     // In this test, we pass a normal nubmer to func and expect zero
     // to be returned due to underflow.
-    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(MANTISSA_WIDTH);
+    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(FRACTION_BITS);
     int32_t exp_array[] = {base_exponent + 5, base_exponent + 4,
                            base_exponent + 3, base_exponent + 2,
                            base_exponent + 1};
@@ -100,7 +100,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
         // Subnormal numbers
         NormalFloat(-FPBits::EXPONENT_BIAS, MANTISSA, 0),
         NormalFloat(-FPBits::EXPONENT_BIAS, MANTISSA, 1)};
-    for (int32_t exp = 0; exp <= static_cast<int32_t>(MANTISSA_WIDTH); ++exp) {
+    for (int32_t exp = 0; exp <= static_cast<int32_t>(FRACTION_BITS); ++exp) {
       for (T x : val_array) {
         // We compare the result of ldexp with the result
         // of the native multiplication/division instruction.
@@ -134,7 +134,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
     ASSERT_EQ(result_bits.get_biased_exponent(), uint16_t(0));
     // But if the exp is so less that normalization leads to zero, then
     // the result should be zero.
-    result = func(x, -FPBits::MAX_EXPONENT - int(MANTISSA_WIDTH) - 5);
+    result = func(x, -FPBits::MAX_EXPONENT - int(FRACTION_BITS) - 5);
     ASSERT_TRUE(FPBits(result).is_zero());
 
     // Start with a subnormal number but pass a very high number for exponent.
diff --git a/libc/test/src/math/LogbTest.h b/libc/test/src/math/LogbTest.h
index 3912385623ef1..d09b6e06ddf8d 100644
--- a/libc/test/src/math/LogbTest.h
+++ b/libc/test/src/math/LogbTest.h
@@ -20,7 +20,7 @@ template <typename T> class LogbTest : public LIBC_NAMESPACE::testing::Test {
   DECLARE_SPECIAL_CONSTANTS(T)
 
   static constexpr UIntType HIDDEN_BIT =
-      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::MANTISSA_WIDTH;
+      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::FRACTION_BITS;
 
 public:
   typedef T (*LogbFunc)(T);
diff --git a/libc/test/src/math/NextAfterTest.h b/libc/test/src/math/NextAfterTest.h
index ca34753871b96..5aa14ceaa5d7b 100644
--- a/libc/test/src/math/NextAfterTest.h
+++ b/libc/test/src/math/NextAfterTest.h
@@ -163,8 +163,7 @@ class NextAfterTestTemplate : public LIBC_NAMESPACE::testing::Test {
     FPBits result_bits = FPBits(result);
     ASSERT_EQ(result_bits.get_biased_exponent(),
               uint16_t(x_bits.get_biased_exponent() - 1));
-    ASSERT_EQ(result_bits.get_mantissa(),
-              (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1);
+    ASSERT_EQ(result_bits.get_mantissa(), FPBits::FRACTION_MASK);
 
     result = func(x, T(33.0));
     result_bits = FPBits(result);
@@ -177,8 +176,7 @@ class NextAfterTestTemplate : public LIBC_NAMESPACE::testing::Test {
     result_bits = FPBits(result);
     ASSERT_EQ(result_bits.get_biased_exponent(),
               uint16_t(x_bits.get_biased_exponent() - 1));
-    ASSERT_EQ(result_bits.get_mantissa(),
-              (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1);
+    ASSERT_EQ(result_bits.get_mantissa(), FPBits::FRACTION_MASK);
 
     result = func(x, T(-33.0));
     result_bits = FPBits(result);
diff --git a/libc/test/src/math/RoundToIntegerTest.h b/libc/test/src/math/RoundToIntegerTest.h
index feee040c72f88..6f0b4cd476df0 100644
--- a/libc/test/src/math/RoundToIntegerTest.h
+++ b/libc/test/src/math/RoundToIntegerTest.h
@@ -192,7 +192,7 @@ class RoundToIntegerTestTemplate : public LIBC_NAMESPACE::testing::Test {
     FPBits bits(F(1.0));
     bits.set_biased_exponent(EXPONENT_LIMIT + FPBits::EXPONENT_BIAS);
     bits.set_sign(1);
-    bits.set_mantissa(UIntType(0x1) << (FPBits::MANTISSA_WIDTH - 1));
+    bits.set_mantissa(FPBits::FRACTION_MASK);
 
     F x = F(bits);
     if (TestModes) {
diff --git a/libc/test/src/math/SqrtTest.h b/libc/test/src/math/SqrtTest.h
index ab14e30d3ded6..9a8fb4d1b1c94 100644
--- a/libc/test/src/math/SqrtTest.h
+++ b/libc/test/src/math/SqrtTest.h
@@ -20,7 +20,7 @@ template <typename T> class SqrtTest : public LIBC_NAMESPACE::testing::Test {
   DECLARE_SPECIAL_CONSTANTS(T)
 
   static constexpr UIntType HIDDEN_BIT =
-      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::MANTISSA_WIDTH;
+      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::FRACTION_BITS;
 
 public:
   typedef T (*SqrtFunc)(T);
diff --git a/libc/test/src/math/smoke/FrexpTest.h b/libc/test/src/math/smoke/FrexpTest.h
index 643a151d89c7d..058fe754bff21 100644
--- a/libc/test/src/math/smoke/FrexpTest.h
+++ b/libc/test/src/math/smoke/FrexpTest.h
@@ -17,7 +17,7 @@ template <typename T> class FrexpTest : public LIBC_NAMESPACE::testing::Test {
   DECLARE_SPECIAL_CONSTANTS(T)
 
   static constexpr UIntType HIDDEN_BIT =
-      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::MANTISSA_WIDTH;
+      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::FRACTION_BITS;
 
 public:
   typedef T (*FrexpFunc)(T, int *);
diff --git a/libc/test/src/math/smoke/LdExpTest.h b/libc/test/src/math/smoke/LdExpTest.h
index 5ebba62a3dbb8..5b1e242d81440 100644
--- a/libc/test/src/math/smoke/LdExpTest.h
+++ b/libc/test/src/math/smoke/LdExpTest.h
@@ -23,7 +23,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
   using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
   using NormalFloat = LIBC_NAMESPACE::fputil::NormalFloat<T>;
   using UIntType = typename FPBits::UIntType;
-  static constexpr UIntType MANTISSA_WIDTH = FPBits::MANTISSA_WIDTH;
+  static constexpr UIntType FRACTION_BITS = FPBits::FRACTION_BITS;
   // A normalized mantissa to be used with tests.
   static constexpr UIntType MANTISSA = NormalFloat::ONE + 0x1234;
 
@@ -69,7 +69,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
   void testUnderflowToZeroOnNormal(LdExpFunc func) {
     // In this test, we pass a normal nubmer to func and expect zero
     // to be returned due to underflow.
-    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(MANTISSA_WIDTH);
+    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(FRACTION_BITS);
     int32_t exp_array[] = {base_exponent + 5, base_exponent + 4,
                            base_exponent + 3, base_exponent + 2,
                            base_exponent + 1};
@@ -82,7 +82,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
   void testUnderflowToZeroOnSubnormal(LdExpFunc func) {
     // In this test, we pass a normal nubmer to func and expect zero
     // to be returned due to underflow.
-    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(MANTISSA_WIDTH);
+    int32_t base_exponent = FPBits::EXPONENT_BIAS + int32_t(FRACTION_BITS);
     int32_t exp_array[] = {base_exponent + 5, base_exponent + 4,
                            base_exponent + 3, base_exponent + 2,
                            base_exponent + 1};
@@ -100,7 +100,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
         // Subnormal numbers
         NormalFloat(-FPBits::EXPONENT_BIAS, MANTISSA, 0),
         NormalFloat(-FPBits::EXPONENT_BIAS, MANTISSA, 1)};
-    for (int32_t exp = 0; exp <= static_cast<int32_t>(MANTISSA_WIDTH); ++exp) {
+    for (int32_t exp = 0; exp <= static_cast<int32_t>(FRACTION_BITS); ++exp) {
       for (T x : val_array) {
         // We compare the result of ldexp with the result
         // of the native multiplication/division instruction.
@@ -134,7 +134,7 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
     ASSERT_EQ(result_bits.get_biased_exponent(), uint16_t(0));
     // But if the exp is so less that normalization leads to zero, then
     // the result should be zero.
-    result = func(x, -FPBits::MAX_EXPONENT - int(MANTISSA_WIDTH) - 5);
+    result = func(x, -FPBits::MAX_EXPONENT - int(FRACTION_BITS) - 5);
     ASSERT_TRUE(FPBits(result).is_zero());
 
     // Start with a subnormal number but pass a very high number for exponent.
diff --git a/libc/test/src/math/smoke/LogbTest.h b/libc/test/src/math/smoke/LogbTest.h
index 41b356fe0524e..2a5a93b44c93e 100644
--- a/libc/test/src/math/smoke/LogbTest.h
+++ b/libc/test/src/math/smoke/LogbTest.h
@@ -17,7 +17,7 @@ template <typename T> class LogbTest : public LIBC_NAMESPACE::testing::Test {
   DECLARE_SPECIAL_CONSTANTS(T)
 
   static constexpr UIntType HIDDEN_BIT =
-      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::MANTISSA_WIDTH;
+      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::FRACTION_BITS;
 
 public:
   typedef T (*LogbFunc)(T);
diff --git a/libc/test/src/math/smoke/NextAfterTest.h b/libc/test/src/math/smoke/NextAfterTest.h
index 90155a8b293f8..e8a7281fc6754 100644
--- a/libc/test/src/math/smoke/NextAfterTest.h
+++ b/libc/test/src/math/smoke/NextAfterTest.h
@@ -174,8 +174,7 @@ class NextAfterTestTemplate : public LIBC_NAMESPACE::testing::Test {
     FPBits result_bits = FPBits(result);
     ASSERT_EQ(result_bits.get_biased_exponent(),
               uint16_t(x_bits.get_biased_exponent() - 1));
-    ASSERT_EQ(result_bits.get_mantissa(),
-              (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1);
+    ASSERT_EQ(result_bits.get_mantissa(), FPBits::FRACTION_MASK);
 
     result = func(x, T(33.0));
     result_bits = FPBits(result);
@@ -188,8 +187,7 @@ class NextAfterTestTemplate : public LIBC_NAMESPACE::testing::Test {
     result_bits = FPBits(result);
     ASSERT_EQ(result_bits.get_biased_exponent(),
               uint16_t(x_bits.get_biased_exponent() - 1));
-    ASSERT_EQ(result_bits.get_mantissa(),
-              (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1);
+    ASSERT_EQ(result_bits.get_mantissa(), FPBits::FRACTION_MASK);
 
     result = func(x, T(-33.0));
     result_bits = FPBits(result);
diff --git a/libc/test/src/math/smoke/NextTowardTest.h b/libc/test/src/math/smoke/NextTowardTest.h
index bd719275a4155..8a6bd1c40b570 100644
--- a/libc/test/src/math/smoke/NextTowardTest.h
+++ b/libc/test/src/math/smoke/NextTowardTest.h
@@ -188,8 +188,7 @@ class NextTowardTestTemplate : public LIBC_NAMESPACE::testing::Test {
     FPBits result_bits = FPBits(result);
     ASSERT_EQ(result_bits.get_biased_exponent(),
               uint16_t(x_bits.get_biased_exponent() - 1));
-    ASSERT_EQ(result_bits.get_mantissa(),
-              (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1);
+    ASSERT_EQ(result_bits.get_mantissa(), FPBits::FRACTION_MASK);
 
     result = func(x, 33.0);
     result_bits = FPBits(result);
@@ -202,8 +201,7 @@ class NextTowardTestTemplate : public LIBC_NAMESPACE::testing::Test {
     result_bits = FPBits(result);
     ASSERT_EQ(result_bits.get_biased_exponent(),
               uint16_t(x_bits.get_biased_exponent() - 1));
-    ASSERT_EQ(result_bits.get_mantissa(),
-              (UIntType(1) << FPBits::MANTISSA_WIDTH) - 1);
+    ASSERT_EQ(result_bits.get_mantissa(), FPBits::FRACTION_MASK);
 
     result = func(x, -33.0);
     result_bits = FPBits(result);
diff --git a/libc/test/src/math/smoke/SqrtTest.h b/libc/test/src/math/smoke/SqrtTest.h
index dffff520cd69e..8628658b9b1d4 100644
--- a/libc/test/src/math/smoke/SqrtTest.h
+++ b/libc/test/src/math/smoke/SqrtTest.h
@@ -17,7 +17,7 @@ template <typename T> class SqrtTest : public LIBC_NAMESPACE::testing::Test {
   DECLARE_SPECIAL_CONSTANTS(T)
 
   static constexpr UIntType HIDDEN_BIT =
-      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::MANTISSA_WIDTH;
+      UIntType(1) << LIBC_NAMESPACE::fputil::FloatProperties<T>::FRACTION_BITS;
 
 public:
   typedef T (*SqrtFunc)(T);
diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index 68146dff64c4e..c568d7ec54a0e 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -468,7 +468,7 @@ class MPFRNumber {
       mpfr_sub(inputMPFR.value, value, inputMPFR.value, MPFR_RNDN);
       mpfr_abs(inputMPFR.value, inputMPFR.value, MPFR_RNDN);
       mpfr_mul_2si(inputMPFR.value, inputMPFR.value,
-                   -thisExponent + int(fputil::FPBits<T>::MANTISSA_WIDTH),
+                   -thisExponent + int(fputil::FPBits<T>::FRACTION_BITS),
                    MPFR_RNDN);
       return inputMPFR;
     }
@@ -496,12 +496,12 @@ class MPFRNumber {
 
     mpfr_sub(minMPFR.value, pivot.value, minMPFR.value, MPFR_RNDN);
     mpfr_mul_2si(minMPFR.value, minMPFR.value,
-                 -minExponent + int(fputil::FPBits<T>::MANTISSA_WIDTH),
+                 -minExponent + int(fputil::FPBits<T>::FRACTION_BITS),
                  MPFR_RNDN);
 
     mpfr_sub(maxMPFR.value, maxMPFR.value, pivot.value, MPFR_RNDN);
     mpfr_mul_2si(maxMPFR.value, maxMPFR.value,
-                 -maxExponent + int(fputil::FPBits<T>::MANTISSA_WIDTH),
+                 -maxExponent + int(fputil::FPBits<T>::FRACTION_BITS),
                  MPFR_RNDN);
 
     mpfr_add(minMPFR.value, minMPFR.value, maxMPFR.value, MPFR_RNDN);



More information about the libc-commits mailing list