src/unchained/utils

Search:
Group by:
Source   Edit  

Number of digits to use as epsilon for unit comparison in almostEqual

Procs

proc almostEqual(a, b: FloatType; epsilon = 10 ^ -8): bool {....raises: [],
    tags: [], forbids: [].}
Comparison of two floats, taken from datamancer implementation. Only used internally to compare two units. Source   Edit  

Macros

macro `^`(x: typed; num: static int): untyped

general purpose power using ^ for integers, which works for any type by rewriting to a product of *.

For the special cases of -1, 0, 1 we simply rewrite to the correct result. Negative powers are written as 1 / x^p

Source   Edit