diff options
Diffstat (limited to 'std/Number/Ternary.bruijn')
-rw-r--r-- | std/Number/Ternary.bruijn | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/std/Number/Ternary.bruijn b/std/Number/Ternary.bruijn index f63d9ac..20a89e8 100644 --- a/std/Number/Ternary.bruijn +++ b/std/Number/Ternary.bruijn @@ -59,11 +59,11 @@ t⁰? [0 false false true] ⧗ Trit → Boolean :test (↑⁰(+42)) ((+126)) # shifts a specified trit into a balanced ternary number -up [[[[[[5 2 1 0 (4 3 2 1 0)]]]]]] ⧗ Trit → Number → Number +…↑… [[[[[[5 2 1 0 (4 3 2 1 0)]]]]]] ⧗ Trit → Number → Number -:test (up t⁻ (+42)) (↑⁻(+42)) -:test (up t⁺ (+42)) (↑⁺(+42)) -:test (up t⁰ (+42)) (↑⁰(+42)) +:test (t⁻ ↑ (+42)) (↑⁻(+42)) +:test (t⁺ ↑ (+42)) (↑⁺(+42)) +:test (t⁰ ↑ (+42)) (↑⁰(+42)) # infinity # WARNING: using this mostly results in undefined behavior! (TODO?) @@ -249,7 +249,7 @@ dec [~(0 z a⁻ a⁺ a⁰)] ⧗ Number → Number 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⁰)] - b⁰ [up 1 (3 0 t⁰)] + b⁰ [1 ↑ (3 0 t⁰)] b⁺ [1 ↑⁰(3 0 t⁰) ↑⁻(3 0 t⁺) ↑⁺(3 0 t⁰)] a⁻ [[[1 (b⁻ 1) b⁻' b⁰ b⁻]]] b⁻' [1 ↑⁰(3 0 t⁻) ↑⁻(3 0 t⁰) ↑⁺(3 0 t⁻)] |