[libc-commits] [libc] [llvm] [libc][math][c23] Implement higher math function `cbrtf16` in LLVM libc (PR #132484)
    via libc-commits 
    libc-commits at lists.llvm.org
       
    Sat Mar 22 10:09:48 PDT 2025
    
    
  
================
@@ -94,10 +94,9 @@ LLVM_LIBC_FUNCTION(float16, cbrtf16, (float16 x)) {
   float xf = static_cast<float>(x);
   FloatBits xf_bits(xf);
 
-  unsigned x_e = static_cast<unsigned>(xf_bits.get_exponent());
-  unsigned out_e = x_e / 3 + 127;
-
-  unsigned shift_e = x_e % 3;
+  uint32_t x_e = xf_bits.get_biased_exponent();
----------------
lntue wrote:
Please add the comments to explain how we derived the exponent computations.
https://github.com/llvm/llvm-project/pull/132484
    
    
More information about the libc-commits
mailing list