[libc-commits] [PATCH] D80779: [libc] Add implementations of round and roundf.

Anthony Steinhauser via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jun 8 11:35:32 PDT 2020


asteinhauser accepted this revision.
asteinhauser added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/utils/FPUtil/FloatOperations.h:224
+
+  // If x is infinity NaN or zero, return it.
+  if (bitsAreInfOrNaN(bits) || bitsAreZero(bits))
----------------
Missing comma:
// If x is infinity, NaN or zero, return it.


================
Comment at: libc/utils/FPUtil/FloatOperations.h:236-242
+  if (exponent == -1) {
+    // Absolute value of x is greater than equal to 0.5 but less than 1.
+    if (isNeg)
+      return T(-1.0);
+    else
+      return T(1.0);
+  }
----------------
Is this necessary?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80779/new/

https://reviews.llvm.org/D80779





More information about the libc-commits mailing list