summary refs log tree commit diff stats
path: root/lib/pure/random.nim
Commit message (Collapse)AuthorAgeFilesLines
* Rename `Time.nanoseconds` to `nanosecond` (#7673)Oscar Nihlgård2018-04-251-1/+1
| | | | | | * Rename `Time.nanoseconds` to `nanosecond` * Fix bug with Duration comparision
* Sub second time resolution (#6978)Oscar Nihlgård2018-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add deprecation warnings to recently deprecated procs * Fix bad usage of the times module * Introduce sub second resolution * Fix usage of C's time() * Switch to nanosecond resolution * Make Time & Duration opaque again and fix some errors * Change back to TimeInterval for shorthands * Fix JS test * Fix build error for windows * Undeprecate epochTime * Documentation and minor changes * Lots of bugfixes and doc comments * Attempt to make travis & appveyor green * Fix edge cases for dealing with the local timezone * Workaround JS backend overflow/underflow bug * Use better workaround for not knowing the size of time_t * Use all available timezones for tests * Fix indentation * Add procs for accessing the fractional part of a duration * Order time units from smallest to largest since it makes more sense * Include months and years in `TimeUnit` * Review fix
* Fixed crash in rand (#7103)Yuriy Glukhov2018-01-181-0/+5
|
* Better times module (#6552)GULPF2017-12-181-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First work on better timezones * Update tests to new api. Removed tests for checking that `isDst` was included when formatting, since `isDst` no longer affects utc offset (the entire utc offset is stored directly in `utcOffset` instead). * Deprecate getLocaltime & getGmTime * Add `now()` as a shorthand for GetTIme().inZone(Local) * Add FedericoCeratto's timezone tests (#6548) * Run more tests in all timezones * Make month enum start at 1 instead of 0 * Deprecate getDayOfWeekJulian * Fix issues with gc safety * Rename TimeInfo => DateTime * Fixes #6465 * Improve isLeapYear * FIx handling negative adjTime * Cleanup: - deprecated toSeconds and fromSeconds, added fromUnix and toUnix instead (that returns int64 instead of float) - added missing doc comments - removed some unnecessary JS specific implementations * Fix misstake in JS `-` for Time * Update usage of TimeEffect * Removed unecessary use of `difftime` * JS fix for local tz * Fix subtraction of months * Fix `days` field in `toTimeInterval` * Style and docs * Fix getDayOfYear for real this time... * Fix handling of adding/subtracting time across dst transitions * Fix some bad usage of the times module in the stdlib * Revert to use proper time resoultion for seeding in random.nim * Move deprecated procs to bottom of file * Always use `epochTime` in `randomize` * Remove TimeInterval normalization * Fixes #6905 * Fix getDayOfWeek for year < 1 * Export toEpochDay/fromEpochDay and change year/month/monthday order * Add asserts for checking that the monthday is valid * Fix some remaining ambiguous references to `Time` * Fix ambiguous reference to Time
* make JS tests green againAraq2017-12-151-1/+1
|
* many improvements to random.nim; fixes #4726Araq2017-12-141-26/+97
|
* fixes #6631Andreas Rumpf2017-10-301-1/+1
|
* work in progress: new implementation for 'a[^1]'Andreas Rumpf2017-10-291-1/+1
|
* Fixed randomize for 32bit target (#6167)Yuriy Glukhov2017-08-011-2/+2
|
* fixes #5966Fabian Keller2017-06-201-1/+2
|
* fixes #5430Araq2017-02-261-1/+1
|
* fixed bug when the first random(max: float) call is the same value, ↵Vladar42017-01-201-0/+1
| | | | regardless of randomize() (#5257)
* random.shuffle now takes an openArray procAndreas Rumpf2017-01-111-2/+7
|
* Documented `shuffle` from `random` module (#5204)Benjamin Summerton2017-01-111-0/+1
|
* make random.nim work for the JS target againAraq2017-01-081-2/+4
|
* random.nim: added shuffle proc; fixes 'mod' biasAraq2017-01-081-2/+12
|
* random.nim: add a warning about crypo; refs #5047Araq2017-01-071-0/+1
|
* Fix few typosFederico Ceratto2016-10-171-2/+2
|
* Random module: fix links, improve header.Matthew Baulch2016-07-181-5/+4
|
* documentation build cleaned upAndreas Rumpf2016-05-311-3/+5
|
* make test greenAndreas Rumpf2016-05-301-20/+38
|
* moved random procs from math to its own module (breaking change)Andreas Rumpf2016-05-301-0/+23
|
* added pure Nim random stdlib moduleAndreas Rumpf2016-05-301-0/+86