summary refs log tree commit diff stats
path: root/lib/pure/math.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* documentation: remove author field [ci skip]narimiran2019-01-171-3/+0
|
* better docs: mathnarimiran2019-01-161-97/+420
|
* Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? (#10084)c-blake2018-12-311-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? CDF is a standard ident in all things related to random numbers/sampling, and full words "cumulativeDistributionFunction" would be silly long, in this case, IMO. We use lowercase `cdf` to make it not look like a type, remove all looping from `sample` letting callers do it. Besides just side-stepping any `sampleSize` name choice, callers may want to filter out samples anyway which this makes slightly simpler. Also add two variants of `cumsum`, value return and in-place update distinguished by the var-ness of the first argument. Add tests for `int` and `float` for both `cumsum` and the new `sample`. (The sample tests exercise the value return mode of `cumsum`.) Functionality pre-this-PR `sample(a, w)` is now the almost as simple `for i in 0..<n: sample(a, w.cumsum)`, but this new code factoring is almost surely better. The statistical tests pass, as before. * Address Araq comment in https://github.com/nim-lang/Nim/pull/10084 We can always add in some `var` version later if desired to save memory, but this change now at least firms up the `sample` interface. * Rename `cumsum` -> `cumsummed` to honor NEP1 style. Re-instate `cumsum` as the in-place transformation. Test both in `tests/stdlib/tmath.nim` and use `cumsummed` in the example code for sample since that's a simpler example. * Fix requests from https://github.com/nim-lang/Nim/pull/10084 : example in lib/pure/math.nim and comment whitespace in lib/pure/random.nim
* Fix #9585 hypot in jsB3liever2018-10-311-1/+2
|
* more examples for mod and div, plus corrections [ci skip]narimiran2018-10-281-8/+46
|
* Documentation improved for `math` module (#9266)eqperes2018-10-101-79/+171
|
* fix for #9082 (#9089)Arne Döring2018-10-091-14/+16
|
* math.nim: document what to use instead of 'fmod'Araq2018-09-251-2/+2
|
* fixes 8594 (#8721)cooldome2018-08-221-1/+1
|
* Merge pull request #8628 from hlaaftana/patch-1Dominik Picheta2018-08-141-2/+2
|\ | | | | Small documentation typo in math
| * Small documentation typo in mathhlaaf2018-08-141-2/+2
| |
* | Haiku support for Nim (#8542)alaviss2018-08-141-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * posix_other: Haiku now has spawn.h This is added per https://dev.haiku-os.org/ticket/13446 * posix_other: Add Haiku specific Dirent members * cpuinfo: Add an implementation for Haiku * distros: Add basic Haiku support * encodings: update Haiku support * fenv, math: Haiku now provides libm * times: Add Haiku struct members * ansi_c, osalloc: Add Haiku constants * threads: Add Haiku support * testament: Haiku uses LIBRARY_PATH * nim.cfg: Update Haiku support libnetwork should only be linked if network functions are used * threads: Haiku does not support -pthread switch * tworkingdir: Haiku's env is in /bin * posix_other: add SIGKILLTHR for Haiku * sockets: link with libnetwork on Haiku * coro: correct ucontext.h location http://pubs.opengroup.org/onlinepubs/009696699/basedefs/ucontext.h.html * coro: ucontext backend is not available on Haiku Haiku doesn't provide the <ucontext.h> header, as it was removed from POSIX * coro: fix setjmp backend The compiler does not allow statements after a noreturn function * nativesockets: Haiku doesn't support AI_V4MAPPED * system: hostOS can contains "haiku" * os: add support for Haiku's packagefs packagefs is read-only, but there are writable holes to the underlying file system as well * os: update constant for Haiku
* fixes #8421, fixes #7968, Nim compiler compiles with MSVC C89 version (#8556)andri lim2018-08-071-24/+58
|