[llvm] MathExtras: rewrite two methods to never overflow (PR #95556)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 08:59:09 PDT 2024


================
@@ -461,9 +467,11 @@ inline int64_t mod(int64_t Numerator, int64_t Denominator) {
   return Mod < 0 ? Mod + Denominator : Mod;
 }
 
-/// Returns the integer nearest(Numerator / Denominator).
+/// Returns (Numerator / Denominator) rounded by round-half-up. Guranteed to
----------------
jayfoad wrote:

```suggestion
/// Returns (Numerator / Denominator) rounded by round-half-up. Guaranteed to
```

https://github.com/llvm/llvm-project/pull/95556


More information about the llvm-commits mailing list