diff options
Diffstat (limited to 'std/Number/Ternary.bruijn')
-rw-r--r-- | std/Number/Ternary.bruijn | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/std/Number/Ternary.bruijn b/std/Number/Ternary.bruijn index 9fb075e..f115349 100644 --- a/std/Number/Ternary.bruijn +++ b/std/Number/Ternary.bruijn @@ -327,12 +327,15 @@ compare-case [[[[[go (1 - 0)]]]]] ⧗ a → b → c → Number → Number → d go [=?0 5 (>?0 4 3)] # returns 1 if a>b, -1 if a<b and 0 if a=b +# also: spaceship operator compare compare-case (+0) (+1) (-1) ⧗ Number → Number → Number :test (compare (+2) (+2)) ((+0)) :test (compare (+2) (+1)) ((+1)) :test (compare (+1) (+2)) ((-1)) +…<=>… compare + # negates a balanced ternary number if <0 abs [<?0 -0 0] ⧗ Number → Number |