[PATCH] D63049: Coding Standard: Prefer `int` for regular arithmetic

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 8 10:53:23 PDT 2019


jdoerfert added inline comments.


================
Comment at: llvm/docs/CodingStandards.rst:1553
+subtraction would produce some huge number. This happens even when working
+with seemingly harmless numbers like A=2, B=2, and C=3.
+
----------------
I think I lost my elementary school algebra over the years. What I get is:

```
A + B > C        | - B

A     > C - B
```

And with `A = 2, B = 2, C = 3`:
```
2 + 2 > 3       <=> 4 > 3
2     > 3 - 2   <=> 2 > 1
```

What am I missing here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63049





More information about the llvm-commits mailing list