Liking cljdoc? Tell your friends :D

helins.htm.math

Miscellaneous math functions.

Miscellaneous math functions.
raw docstring

absclj

(abs x)

Returns the absolute value.

Returns the absolute value.
sourceraw docstring

durstenfeld-shuffleclj

(durstenfeld-shuffle rng collection)

Durstenfeld version of the Fisher-Yates shuffle.

Durstenfeld version of the Fisher-Yates shuffle.
sourceraw docstring

factorialclj

(factorial n)

Computes a factorial.

Computes a factorial.
sourceraw docstring

fit-to-rangeclj

(fit-to-range value)
(fit-to-range max-value value)
(fit-to-range min-value max-value value)

Returns value' constrained to be between min-value and max-value inclusive.

Boundaries are 0 and 1 if not given.

Returns value' constrained to be between `min-value` and `max-value` inclusive.

Boundaries are 0 and 1 if not given.
sourceraw docstring

meanclj

(mean sq)

Computes the mean of a sequence.

Computes the mean of a sequence.
sourceraw docstring

min-max-normalizationclj

(min-max-normalization min-value max-value value)

Normalizes a numerical value between min-value and max-value.

Values out of range are treated as extreme values.

Normalizes a numerical value between `min-value` and `max-value`.

Values out of range are treated as extreme values.
sourceraw docstring

n-combinationsclj

(n-combinations n k)

Counts the number of combinations of n choose k.

Counts the number of combinations of n choose k.
sourceraw docstring

random-intclj

(random-int rng max-int)
(random-int rng min-int max-int)

Using a given random number generator for numbers between 0 (inclusive) and 1 (exclusive), generates an integer between min-int (inclusive) and max-int (exclusive).

Using a given random number generator for numbers between 0 (inclusive) and 1 (exclusive), generates an integer
between `min-int` (inclusive) and `max-int` (exclusive).
sourceraw docstring

reservoir-sample-intsclj

(reservoir-sample-ints rng max-int n-sample)
(reservoir-sample-ints rng min-int max-int n-sample)

Randomly samples n-sample integers between min-int (inclusive, defaults to 0) and max-int (exclusive).

Randomly samples `n-sample` integers between `min-int` (inclusive, defaults to 0) and `max-int` (exclusive).
sourceraw docstring

roundclj

(round x)

Rounds a number.

Rounds a number.
sourceraw docstring

wrap-to-rangeclj

(wrap-to-range value)
(wrap-to-range max-value value)
(wrap-to-range min-value max-value value)

Like fit-to-range but the value is wrapped as if the range was cyclic.

Ex. (wrap-to-range 0 10 -3) => 6

Like `fit-to-range` but the value is wrapped as if the range was cyclic.


Ex. (wrap-to-range 0
                   10
                   -3)
    => 6
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close