Bug 6381 – math.floor, math.ceil are not pure functions.

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-25T15:20:00Z
Last change time
2013-08-30T00:26:38Z
Assigned to
nobody
Creator
andrew.spott

Comments

Comment #0 by andrew.spott — 2011-07-25T15:20:59Z
I'm not sure if there is a valid reason for this that I'm not understanding, but why are these (rather basic) functions not pure? It seems to me that it would be best to have most of the std.math functions be pure if only because they can.
Comment #1 by hsteoh — 2013-08-27T08:07:55Z
The latest std.math now has pure ceil/floor (and most of the other functions), thanks to Iain.
Comment #2 by hsteoh — 2013-08-28T21:06:03Z
Comment #3 by github-bugzilla — 2013-08-30T00:26:38Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5a622e0fb14ecfc25b18e07c91611f08fd271ffe Add unittest for issue 6381. To prevent regressions. https://github.com/D-Programming-Language/phobos/commit/89621079d100d36950ab79ff86d217cc32291e2f Merge pull request #1531 from quickfur/issue6381 Add unittest for issue 6381 (std.math.floor/ceil should be pure)