tmp/tmpmzsf8edb/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Absolute values <a id="c.math.abs">[[c.math.abs]]</a>
|
| 2 |
+
|
| 3 |
+
[*Note 1*: The headers `<cstdlib>` ([[cstdlib.syn]]) and `<cmath>` (
|
| 4 |
+
[[cmath.syn]]) declare the functions described in this
|
| 5 |
+
subclause. — *end note*]
|
| 6 |
+
|
| 7 |
+
``` cpp
|
| 8 |
+
int abs(int j);
|
| 9 |
+
long int abs(long int j);
|
| 10 |
+
long long int abs(long long int j);
|
| 11 |
+
float abs(float j);
|
| 12 |
+
double abs(double j);
|
| 13 |
+
long double abs(long double j);
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
*Effects:* The `abs` functions have the semantics specified in the C
|
| 17 |
+
standard library for the functions `abs`, `labs`, `llabs`, `fabsf`,
|
| 18 |
+
`fabs`, and `fabsl`.
|
| 19 |
+
|
| 20 |
+
*Remarks:* If `abs()` is called with an argument of type `X` for which
|
| 21 |
+
`is_unsigned_v<X>` is `true` and if `X` cannot be converted to `int` by
|
| 22 |
+
integral promotion ([[conv.prom]]), the program is ill-formed.
|
| 23 |
+
|
| 24 |
+
[*Note 1*: Arguments that can be promoted to `int` are permitted for
|
| 25 |
+
compatibility with C. — *end note*]
|
| 26 |
+
|
| 27 |
+
ISO C 7.12.7.2, 7.22.6.1
|
| 28 |
+
|