D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18247 - core.stdc.math functions that never set errno should be pure
Summary: core.stdc.math functions that never set errno should be pure
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-17 05:26 UTC by Nathan S.
Modified: 2018-02-07 08:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nathan S. 2018-01-17 05:26:03 UTC
core.stdc.math functions that never set errno should be pure. These include:

* cos, sin, tan, atan;
* tanh, asinh;
* frexp, modf;
* cbrt;
* erf;
* ceil, floor, trunc, round, rint, nearbyint;
* copysign, nan;
* fdim, fmax, fmin;
* fabs, abs, fma;
* fpclassify, isfinite, isinf, isnan, isnormal, signbit;
* isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered.
Comment 1 Nathan S. 2018-01-17 10:07:09 UTC
cos, sin, tan should be removed from list of pure functions. On some platforms they set errno, on others not. See discussion at https://github.com/dlang/druntime/pull/2045
Comment 2 github-bugzilla 2018-02-07 08:00:51 UTC
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/4c1b9a3a3dfb2ac69bf98fdd5c633737ad7998c5
Fix Issue 18247 - core.stdc.math functions that never set errno should be pure

https://github.com/dlang/druntime/commit/760fd82820dc686436fccb5617a4b8f9aa406ee7
Merge pull request #2045 from n8sh/pure-stdc-math

Fix Issue 18247 - core.stdc.math functions that never set errno should be pure
merged-on-behalf-of: Iain Buclaw <ibuclaw@gdcproject.org>