libm: Make this work with overflow checks
Some math functions currently panic when compiled with overflow checks enabled (which is the default for dev builds). To fix this problem the Wrapping newtype and/or wrapping ops needs to be used in some parts of the implementations.
To test that this works with overflow checks enabled uncomment this line in ci/script.sh.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 15 (9 by maintainers)
Just a fyi: I found a case that may need to use wrapping:
Calling sqrt(2.0) in debug mode gives me: (using git master branch Oct 31, 2018)