tmp/tmp3qsvr4ja/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
## C library <a id="c.math">[[c.math]]</a>
|
| 2 |
|
| 3 |
The header `<ctgmath>` simply includes the headers `<ccomplex>` and
|
| 4 |
`<cmath>`.
|
| 5 |
|
| 6 |
-
The overloads provided in C by
|
| 7 |
-
`<ccomplex>` and `<cmath>` by “sufficient” additional overloads.
|
| 8 |
|
| 9 |
Tables [[tab:numerics.hdr.cmath]] and [[tab:numerics.hdr.cstdlib]]
|
| 10 |
describe headers `<cmath>` and `<cstdlib>`, respectively.
|
| 11 |
|
| 12 |
The contents of these headers are the same as the Standard C library
|
|
@@ -16,11 +16,13 @@ changes:
|
|
| 16 |
The `rand` function has the semantics specified in the C standard,
|
| 17 |
except that the implementation may specify that particular library
|
| 18 |
functions may call `rand`. It is implementation-defined whether the
|
| 19 |
`rand` function may introduce data races ([[res.on.data.races]]). The
|
| 20 |
random number generation ([[rand]]) facilities in this standard are
|
| 21 |
-
often preferable to `rand`
|
|
|
|
|
|
|
| 22 |
|
| 23 |
In addition to the `int` versions of certain math functions in
|
| 24 |
`<cstdlib>`, C++adds `long` and `long long` overloaded versions of these
|
| 25 |
functions, with the same semantics.
|
| 26 |
|
|
@@ -208,18 +210,19 @@ bool islessgreater(long double x, long double y);
|
|
| 208 |
bool isunordered(long double x, long double y);
|
| 209 |
```
|
| 210 |
|
| 211 |
Moreover, there shall be additional overloads sufficient to ensure:
|
| 212 |
|
| 213 |
-
1. If any argument corresponding to a `double` parameter has
|
| 214 |
-
`long double`, then all arguments corresponding to
|
| 215 |
-
parameters are effectively cast to `long double`.
|
| 216 |
-
2. Otherwise, if any argument corresponding to a `double`
|
| 217 |
-
type `double` or an integer type, then all
|
| 218 |
-
to `double` parameters are effectively cast
|
| 219 |
-
|
| 220 |
-
|
|
|
|
| 221 |
|
| 222 |
ISO C 7.5, 7.10.2, 7.10.6.
|
| 223 |
|
| 224 |
<!-- Link reference definitions -->
|
| 225 |
[accumulate]: #accumulate
|
|
@@ -237,10 +240,11 @@ ISO C 7.5, 7.10.2, 7.10.6.
|
|
| 237 |
[class.gslice.overview]: #class.gslice.overview
|
| 238 |
[class.slice]: #class.slice
|
| 239 |
[class.slice.overview]: #class.slice.overview
|
| 240 |
[cmplx.over]: #cmplx.over
|
| 241 |
[complex]: #complex
|
|
|
|
| 242 |
[complex.member.ops]: #complex.member.ops
|
| 243 |
[complex.members]: #complex.members
|
| 244 |
[complex.numbers]: #complex.numbers
|
| 245 |
[complex.ops]: #complex.ops
|
| 246 |
[complex.special]: #complex.special
|
|
|
|
| 1 |
## C library <a id="c.math">[[c.math]]</a>
|
| 2 |
|
| 3 |
The header `<ctgmath>` simply includes the headers `<ccomplex>` and
|
| 4 |
`<cmath>`.
|
| 5 |
|
| 6 |
+
The overloads provided in C by type-generic macros are already provided
|
| 7 |
+
in `<ccomplex>` and `<cmath>` by “sufficient” additional overloads.
|
| 8 |
|
| 9 |
Tables [[tab:numerics.hdr.cmath]] and [[tab:numerics.hdr.cstdlib]]
|
| 10 |
describe headers `<cmath>` and `<cstdlib>`, respectively.
|
| 11 |
|
| 12 |
The contents of these headers are the same as the Standard C library
|
|
|
|
| 16 |
The `rand` function has the semantics specified in the C standard,
|
| 17 |
except that the implementation may specify that particular library
|
| 18 |
functions may call `rand`. It is implementation-defined whether the
|
| 19 |
`rand` function may introduce data races ([[res.on.data.races]]). The
|
| 20 |
random number generation ([[rand]]) facilities in this standard are
|
| 21 |
+
often preferable to `rand`, because `rand`’s underlying algorithm is
|
| 22 |
+
unspecified. Use of `rand` therefore continues to be nonportable, with
|
| 23 |
+
unpredictable and oft-questionable quality and performance.
|
| 24 |
|
| 25 |
In addition to the `int` versions of certain math functions in
|
| 26 |
`<cstdlib>`, C++adds `long` and `long long` overloaded versions of these
|
| 27 |
functions, with the same semantics.
|
| 28 |
|
|
|
|
| 210 |
bool isunordered(long double x, long double y);
|
| 211 |
```
|
| 212 |
|
| 213 |
Moreover, there shall be additional overloads sufficient to ensure:
|
| 214 |
|
| 215 |
+
1. If any arithmetic argument corresponding to a `double` parameter has
|
| 216 |
+
type `long double`, then all arithmetic arguments corresponding to
|
| 217 |
+
`double` parameters are effectively cast to `long double`.
|
| 218 |
+
2. Otherwise, if any arithmetic argument corresponding to a `double`
|
| 219 |
+
parameter has type `double` or an integer type, then all arithmetic
|
| 220 |
+
arguments corresponding to `double` parameters are effectively cast
|
| 221 |
+
to `double`.
|
| 222 |
+
3. Otherwise, all arithmetic arguments corresponding to `double`
|
| 223 |
+
parameters have type `float`.
|
| 224 |
|
| 225 |
ISO C 7.5, 7.10.2, 7.10.6.
|
| 226 |
|
| 227 |
<!-- Link reference definitions -->
|
| 228 |
[accumulate]: #accumulate
|
|
|
|
| 240 |
[class.gslice.overview]: #class.gslice.overview
|
| 241 |
[class.slice]: #class.slice
|
| 242 |
[class.slice.overview]: #class.slice.overview
|
| 243 |
[cmplx.over]: #cmplx.over
|
| 244 |
[complex]: #complex
|
| 245 |
+
[complex.literals]: #complex.literals
|
| 246 |
[complex.member.ops]: #complex.member.ops
|
| 247 |
[complex.members]: #complex.members
|
| 248 |
[complex.numbers]: #complex.numbers
|
| 249 |
[complex.ops]: #complex.ops
|
| 250 |
[complex.special]: #complex.special
|