aboutsummaryrefslogtreecommitdiff
path: root/impl.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-31 10:47:53 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-31 10:47:53 -0400
commit1a15fa1cb984dd1d6bd3f5c5b56e0169b1085edf (patch)
treecb57cee8bdf8f9e8bcfb5617c400a8630c0f2784 /impl.bqn
parent0d13401bde67f9e8106d8189eec2edb9662d4436 (diff)
Use dyadic inverse instead of inverting a train
Diffstat (limited to 'impl.bqn')
-rw-r--r--impl.bqn6
1 files changed, 3 insertions, 3 deletions
diff --git a/impl.bqn b/impl.bqn
index f03d5c39..026c03f3 100644
--- a/impl.bqn
+++ b/impl.bqn
@@ -1,6 +1,6 @@
β—Ά ← {𝕨((𝕨𝔽𝕩)βŠ‘π•˜){𝔽}𝕩} # LIMITED to number left operand result
⊘ ← {𝕨((1{𝔽}𝕨)-0)◢𝔽‿𝔾 𝕩}
-#⊒ ← {𝕩} # Prevents dyadic negative ⍟
+⊒ ← {𝕩}
⊣ ← {𝕩}⊘{𝕨}
˜ ← {π•©π”½π•¨βŠ£π•©}
∘ ← {𝔽𝕨𝔾𝕩}
@@ -394,11 +394,11 @@ ProgressiveIndexOf ← {π•¨βŠβ—‹(β‰Λ˜βŸœOccurrenceCountπ•¨βŠΈβŠ)𝕩}
_repeat_←{
n←𝕨𝔾𝕩
- f←0βŠ‘π•¨βŸ¨π”½βŸ©βŠ˜βŸ¨π•¨π”½βŠ’βŸ©π•©
l←u←0
{!Int𝕩⋄l↩lβŒŠπ•©β‹„u↩uβŒˆπ•©}βš‡0 n
a←𝕩⋄_p←{π”½βˆ˜βŠ£`(1+𝕩)β₯Š<a}
- pos←F _p u β‹„ neg←F⁼_p-l
+ pos←(𝕨𝔽 ⊒)_p u
+ neg←(π•¨π”½βΌβŠ’)_p-l
(|βŠ‘<⟜0βŠ‘posβ€Ώneg˜)βš‡0 n
}
⍟ ↩ _repeat_