[PATCH] D18161: APFloat: Add frexp
    Steve Canon via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Mar 15 11:54:30 PDT 2016
    
    
  
scanon added inline comments.
================
Comment at: lib/Support/APFloat.cpp:4003
@@ +4002,3 @@
+
+  Exp = Exp == APFloat::IEK_Zero ? 0 : Exp + 1;
+  return scalbn(Val, -Exp, RM);
----------------
Please add a comment explaining that we add 1 because `frexp` is defined to return a normalized fraction in +/-[0.5, 1.0) rather than the usual range +/-[1.0,2).
http://reviews.llvm.org/D18161
    
    
More information about the llvm-commits
mailing list