about summary refs log tree commit diff
path: root/users/sterni/nix/num/default.nix
blob: 64049308372206f4e373d0a13e6086e64ac2de2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{ ... }:

rec {
  inherit (builtins)
    mul
    div
    add
    sub
    ;

  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;
}