mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
16 lines
208 B
Nix
16 lines
208 B
Nix
{
|
|
lib,
|
|
myLib,
|
|
}:
|
|
|
|
rec {
|
|
log2 =
|
|
let
|
|
mylog = x: y: if (x >= 2) then mylog (x / 2) (y + 1) else y;
|
|
in
|
|
x: mylog x 0;
|
|
|
|
clamp =
|
|
min_x: max_x: x:
|
|
lib.min (lib.max x min_x) max_x;
|
|
}
|