mirror of
https://git.mediani.de/mirrors_public/oddlama_nixos-extra-modules.git
synced 2025-10-10 22:10:38 +02:00
fix: tests
fix: arithmeticRight
This commit is contained in:
parent
19b469d1b3
commit
fb68031848
5 changed files with 101 additions and 3 deletions
|
@ -1160,7 +1160,10 @@ let
|
|||
# coshadow :: integer -> (ip | mac | integer) -> (ip | mac | integer)
|
||||
coshadow = n: a: and (not (right n (left n (coerce a (-1))))) a;
|
||||
|
||||
# coerce :: (ip | mac | integer) -> (ip | mac | integer) -> (ip | mac | integer)
|
||||
# coerce target value
|
||||
# coerce value to the type of target
|
||||
# coerce :: A -> (ip | mac | integer) -> A
|
||||
# where A :: (ip | mac | integer)
|
||||
coerce =
|
||||
target: value:
|
||||
if target ? ipv6 then
|
||||
|
|
|
@ -109,7 +109,7 @@ let
|
|||
arithmeticRight =
|
||||
a: b:
|
||||
if a >= 64 then
|
||||
0
|
||||
if b < 0 then -1 else 0
|
||||
else if a == 0 then
|
||||
b
|
||||
else if a < 0 then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue