diff options
author | Marvin Borner | 2024-03-03 15:03:41 +0100 |
---|---|---|
committer | Marvin Borner | 2024-03-03 22:29:24 +0100 |
commit | 6ae44d09faa0ae353c0818705503cad42127d102 (patch) | |
tree | a923d00d520f85a608f51416184e5b3b6f178549 /std/Number/Ternary.bruijn | |
parent | 03155d6e515c76d5ab59f814592484c849313130 (diff) |
Even more samples
wtf
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⁻)] |