tvl-depot/users/sterni/nix/num/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
233 B
Nix
Raw Normal View History

{ ... }:
rec {
inherit (builtins)
mul
div
add
sub
;
sign = i: if i < 0 then -1 else 1;
abs = i: if i < 0 then -i else i;
inRange = a: b: x: x >= a && x <= b;
sum = builtins.foldl' (a: b: a + b) 0;
}