From 7bfc78b122ad9cbb65eed16f7de4d4021547c2a8 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 23 Mar 2024 19:18:16 +0100 Subject: Some Project Euler solutions --- std/Number/Ternary.bruijn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'std/Number/Ternary.bruijn') diff --git a/std/Number/Ternary.bruijn b/std/Number/Ternary.bruijn index 5e93c66..3695740 100644 --- a/std/Number/Ternary.bruijn +++ b/std/Number/Ternary.bruijn @@ -500,10 +500,11 @@ double-shift [[[[[left : right]] (force 2 1) (force 2 0)]]] left force 4 ((mst* 0) ↑ (+0) + (↑⁰1)) right force 4 ↑⁰0 -# efficient quotient/remainder implementation for balanced ternary +# "efficient" quotient/remainder implementation for balanced ternary # technique by Douglas W. Jones # algorithm originally intended for fixed-width numbers (=> ugly hacks with force+log3) # TODO: remove the final `huh` correction step (probably some off-by-one bug?) +# TODO: not actually that efficient right now quot-rem [[[[[z [[[[rec]]]] 1 (+0) 4]]] ?1 ⋀? 6) ⋁? (