fix: tests

fix: arithmeticRight
This commit is contained in:
Patrick 2025-04-15 10:47:11 +02:00
parent 19b469d1b3
commit fb68031848
No known key found for this signature in database
GPG key ID: 451F95EFB8BECD0F
5 changed files with 101 additions and 3 deletions

View file

@ -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

View file

@ -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