Use truncation division in mod for floats (#7118)

* Use truncation division in mod for floats

* Add changelog entry

* Add floorDiv/floorMod to math.nim

* Update changelog
This commit is contained in:
Oscar Nihlgård 2018-05-30 18:14:21 +02:00 • committed by Dmitry Atamanov
commit 65070a6936
2 changed files with 44 additions and 11 deletions

View file

@ -39,6 +39,9 @@
The proc is no longer deprecated.
- ``posix.Timeval.tv_sec`` has changed type to ``posix.Time``.
- ``math.`mod` `` for floats now behaves the same as ``mod`` for integers
(previously it used floor division like Python). Use ``math.floorMod`` for the old behavior.
#### Breaking changes in the compiler
- The undocumented ``#? braces`` parsing mode was removed.
@ -60,6 +63,7 @@
- Added the proc ``algorithm.upperBound``.
- Added inverse hyperbolic functions, ``math.arcsinh``, ``math.arccosh`` and ``math.arctanh`` procs.
- Added cotangent, secant and cosecant procs ``math.cot``, ``math.sec`` and ``math.csc``; and their hyperbolic, inverse and inverse hyperbolic functions, ``math.coth``, ``math.sech``, ``math.csch``, ``math.arccot``, ``math.arcsec``, ``math.arccsc``, ``math.arccoth``, ``math.arcsech`` and ``math.arccsch`` procs.
- Added the procs ``math.floorMod`` and ``math.floorDiv`` for floor based integer division.
### Library changes