diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-12-28 08:01:01 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-12-28 08:01:01 -0500 |
| commit | 86abbfd45d5043963f7f60ab5f69005546b0faa5 (patch) | |
| tree | 5be8ba315f710d9bb0fb7571be042b0d8fa6d9fe /examples | |
| parent | b27deda2ab7e14421c3744575a3ff371e8ca6559 (diff) | |
Fix base-2 length computation in _pow
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/fifty.bqn | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/fifty.bqn b/examples/fifty.bqn index 4b10cbae..c4612415 100644 --- a/examples/fifty.bqn +++ b/examples/fifty.bqn @@ -173,8 +173,7 @@ KnightsTour ← { ! (KnightsTour 6) ≡ 6‿6⥊0‿9‿20‿35‿6‿11‿21‿32‿7‿10‿19‿26‿8‿1‿34‿25‿12‿5‿33‿22‿31‿16‿27‿18‿2‿15‿24‿29‿4‿13‿23‿30‿3‿14‿17‿28 # 34 -# Fails when 𝕩 is 1; the APL version did this too! -_pow ← {𝔽´𝔽˜⍟(/2|⌊∘÷⟜2⍟(↕·⌈2⋆⁼⊢)𝕩)𝕨} +_pow ← {𝔽´𝔽˜⍟(/2|⌊∘÷⟜2⍟(↕1+·⌊2⋆⁼⊢)𝕩)𝕨} ! 847288609443 ≡ 3 ×_pow 25 # 38 |
