summary refs log tree commit diff stats
path: root/lib/pure/math.nim
Commit message (Collapse)AuthorAgeFilesLines
* Add ceilDiv to math (#18596)Tomohiro2021-08-191-0/+52
| | | | | | * Use assert in runnableExamples and improve boundary check * Add more tests for ceilDiv * Fix comment in ceilDiv * Calling ceilDiv with int type T such like sizeof(T) > 8 is error
* fix for #18284 int32 should be int (#18285)Adrian Veith2021-06-171-1/+1
| | | the var exp was typed as int32 - it should be int since frep expects an int
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-211-1/+1
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* don't run one example on 32-bit machines (#17655)Miran2021-04-061-3/+4
| | | | | This example seems to break our 32-bit nightlies builds. This is just a temporary solution (TM) until we figure out a better one.
* Fix #17017 (math edge cases) (#17588)konsumlamm2021-04-011-5/+13
| | | | | | | * Fix #17017 Add more test cases * USe signbit in example
* use lowercase --define switches (#17283)flywind2021-03-071-1/+1
|
* Added assertion to clamp (#17248)Jason Beetham2021-03-041-0/+2
| | | Co-authored-by: flywind <xzsflywind@gmail.com>
* Added math.clamp for slice clamping (#17246)Jason Beetham2021-03-031-0/+10
| | | | | | | * Added math.clamp for slice clamping * Added inline to math.clamp * Cleaned up math.clamp + test
* make copySign for js consistent with other backends (#16609)Timothee Cour2021-02-221-15/+30
| | | | | | * make copySign work more robustly in js * improve tests * improve tests/vm/tcastint.nim
* fix math.frexp function signature (#16725)flywind2021-02-171-36/+52
|
* Improve math module (#17019)konsumlamm2021-02-121-496/+425
| | | | | | | | | | | | | | | | | | | | | | | | | * Improve documentation for math Support empty input for cumsummed Use runnableExamples Move some examples to tests Add more tests * Update tests/stdlib/tmath.nim Move some tests to trandom.nim Move tests into main template where possible Add test for #17017 * Add more tests for gamma & lgamma Remove gamma(-1.0) example Small fixes/changes * Move more tests into template main() * Fix typos * Add edge case examples for copySign
* perpare for more compact bit operations in JS (#16728)flywind2021-01-191-7/+8
|
* minor improvement on math.nim (#16733)flywind2021-01-161-2/+2
|
* add math.signbit (#16592)flywind2021-01-071-1/+26
|
* fix #9125 (#16582)flywind2021-01-051-1/+11
| | | | | | | | | | | | * fix #9125 * Update tests/stdlib/tmath.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * back Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Add math.copySign (#16406)flywind2020-12-301-0/+38
| | | | | * add math.copySign * fix + tests
* add `euclDiv` and `euclMod` to `math` (#16414)flywind2020-12-231-0/+26
| | | | | | | | * add `euclDiv` and `euclMod` to `math` * use abs * Update lib/pure/math.nim Co-authored-by: Clyybber <darkmine956@gmail.com>
* [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)Timothee Cour2020-12-221-0/+2
| | | | | * fix #16428 vmops now works for generic procs * remove duplication
* docs minor for math (#16407)flywind2020-12-201-2/+2
|
* add math.isNaN (#16179)Timothee Cour2020-12-111-0/+21
| | | | | | | * add math.isNaN * isNaN now works with --passc:-ffast-math; tests * Update lib/pure/math.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* math.nim: Use `func` everywhere (#16285)ee72020-12-071-270/+268
| | | | | | | | | | | * math.nim: procs with {.noSideEffect} -> funcs * math.nim: procs without {.noSideEffect.} -> funcs * math.nim: proc -> func in links * math.nim: proc -> func in doc comments * test: add `math` to strictFuncs test
* fixed article duplication typos (#16216)ihlec2020-12-021-1/+1
|
* fix for comparing infinities (#16122)Antonis Geralis2020-11-251-0/+11
|
* move tests to testament (#16101)flywind2020-11-241-125/+0
| | | | | | | | | * move tests to testament * minor * fix random * disable test random
* change some code-blocks to runnableExamples and correct some errors in docs ↵flywind2020-11-121-15/+15
| | | | | | | | | (#15900) * original docs are wrong * fix pathnorm * Update lib/pure/pathnorm.nim Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* add approxequal (#15766)Antonis Geralis2020-10-301-1/+24
| | | | | | | | | | | | * add approxequal * Address review comments, tests that pass * more wikipedia links [ci skip] * forgot since Co-authored-by: b3liever <b3liever@yandex.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove deprecation from `math.round` (#15224)Miran2020-08-251-2/+1
|
* fix #15033 (#15034)Hugo Granström2020-07-221-1/+1
|
* Remove deprecated stuff from stdlib (#14699)Miran2020-06-171-39/+0
| | | | | | | * update to the latest Jester * remove deprecated procs from some stdlib modules * 'criterion' is not maintained anymore and relies on obsolete stuff
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-021-1/+1
| | | | * move since from inclrtl to std/private/since * move since import in system below for HCR
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-1/+1
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* style fix: change 'JS' to 'js' to make it consistent (#13168)Miran2020-01-161-5/+5
|
* fixes #13032Araq2020-01-041-2/+2
|
* Fixes classify function to detect subnormal floating points (#12836)KeepCoolWithCoolidge2019-12-081-16/+20
| | | | | | | | * Fix classify to test for subnormality. * Minor fix. * Modified to maintain existing API. * Minor change. * Removed 32-bit case since float is always 64-bit.
* Fix for 16 bit platforms (#12760) [backend]PMunch2019-11-281-1/+3
| | | | | This fixes some tiny issues with using Nim on 16-bit platforms. Not entirely sure why the AVR chip I was compiling for with "cpu = avr" was detected as 16-bit, but that's probably another issue..
* added support for openArray's for `gcd` and `lcm` (#12621)Yanis Zafirópulos2019-11-071-1/+25
|
* fix several typos in documentation and comments (#12553)Nindaleth2019-10-301-1/+1
|
* Fix many broken links and prefer relative links within docs (#12463)Miran2019-10-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix many broken links Note that contrary to what docgen.rst currently says, the ids have to match exactly or else most web browsers will not jump to the intended symbol. * Prefer relative links for Nim documentation This is more friendly to those browsing the documentation without a network connection. The nim-doc package in Debian allows this, for example. Also, the domain name being used was not consistent. It could have been either nim-lang.org or nim-lang.github.io, and those reading the stable docs could have found themselves suddenly reading the devel docs instead. * koch.rst: remove link to nonexistent section * manual.rst: remove unintended link cast[T](0) is interpreted as a link to id 0 with text T, so escape the opening parentheses to display the intended output. * asyncstreams: replace unintended link with emphasis * Fix word wrapping
| * Fix many broken linksJjp1372019-10-221-1/+1
| | | | | | | | | | | | Note that contrary to what docgen.rst currently says, the ids have to match exactly or else most web browsers will not jump to the intended symbol.
* | [backport] Documentation Math module (#12460)Juan Carlos2019-10-241-0/+2
|/
* [backport] run nimpretty on numbers stuffnarimiran2019-09-301-27/+33
|
* Fix the broken link in math.nim (#11653) [ci skip]Graeme Cross2019-07-041-1/+1
|
* [documentation] fix #4630, document unsupported functions for JSnarimiran2019-06-241-0/+8
|
* Add `cbrt()` bindings for the JS Target (#11528)Benjamin Summerton2019-06-181-0/+3
| | | | | | `Math.cbrt()` exists: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt The binding was missing for the JavaScript backend.
* Render deprecated pragmas (#8886)LemonBoy2019-06-031-13/+7
| | | | | | | | | * Render deprecated pragmas * fix the expected html * clean up the documentation regarding deprecations * fix typo * fix system.nim * fix random
* stdlib: more consistent formattingAraq2019-05-221-5/+5
|
* fix #10910, optimize squaring and cubing (#11291)Miran2019-05-211-16/+21
|
* code cleanup (#10874)Arne Döring2019-03-281-6/+4
|
* 32 bit fixes (#10608)Arne Döring2019-02-131-1/+1
|
* Genode fixes (#10491)Emery Hemingway2019-01-291-1/+1
| | | Readline pasthru, add linker to config, do not pass -lm to linker.