From 7a35dd8650535d1d31c8b152e1074d6f1ebcf8ad Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 5 Mar 2023 23:53:54 +0100 Subject: Switched to prefixed listification --- std/Number/Ternary.bruijn | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'std/Number/Ternary.bruijn') diff --git a/std/Number/Ternary.bruijn b/std/Number/Ternary.bruijn index 84f4d4a..d05caa0 100644 --- a/std/Number/Ternary.bruijn +++ b/std/Number/Ternary.bruijn @@ -142,7 +142,7 @@ mst [B.get t⁰ (0 z a⁻ a⁺ a⁰)] ⧗ Number → Trit :test (mst (+42)) (t⁺) # returns true if balanced ternary number is negative -negative? [t⁻? (mst 0)] ⧗ Number → Boolean +negative? t⁻? ∘ mst ⧗ Number → Boolean ?‣ positive? @@ -252,7 +252,6 @@ dec [~(0 z a⁻ a⁺ a⁰)] ⧗ Number → Number :test (--(+42) =? (+41)) (true) # adds two balanced ternary numbers (can introduce leading 0s) -# second argument gets abstracted (performance) add [[abs 1 →^0]] ⧗ Number → Number → Number abs [c (0 z a⁻ a⁺ a⁰)] b⁻ [1 ↑⁺(3 0 t⁻) ↑⁰(3 0 t⁰) ↑⁻(3 0 t⁰)] @@ -276,7 +275,6 @@ add [[abs 1 →^0]] ⧗ Number → Number → Number :test ((+42) + (+1) =? (+43)) (true) # subs two balanced ternary numbers (can introduce leading 0s) -# second argument gets abstracted (performance) sub [[1 + -0]] ⧗ Number → Number → Number …-… sub @@ -289,7 +287,6 @@ sub [[1 + -0]] ⧗ Number → Number → Number :test ((+42) - (+1) =? (+41)) (true) # returns true if number is greater than other number -# larger numbers should be second argument (performance) gre? [[>?(1 - 0)]] ⧗ Number → Number → Boolean …>?… gre? @@ -299,7 +296,6 @@ gre? [[>?(1 - 0)]] ⧗ Number → Number → Boolean :test ((+3) >? (+2)) (true) # returns true if number is less than other number -# smaller numbers should be second argument (performance) les? \gre? ⧗ Number → Number → Boolean …? 0)]] ⧗ Number → Number → Boolean …≤?… leq? @@ -319,7 +314,6 @@ leq? [[¬(1 >? 0)]] ⧗ Number → Number → Boolean :test ((+3) ≤? (+2)) (false) # returns true if number is greater than or equal to other number -# smaller numbers should be second argument (performance) geq? \leq? ⧗ Number → Number → Boolean …≥?… geq? -- cgit v1.2.3