aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-31 15:00:08 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-31 15:18:45 -0500
commit8a4b759b0da2f6c62f260be8800887a9f48deb80 (patch)
tree440845592b17063ee6684c04a1f1a311cbb52e73
parent579bcc03f6b2033c89446f3ec8fbd01d49f487ad (diff)
Avoid applying function 𝕨 to 𝕩 in Repeat
-rw-r--r--src/r.bqn7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/r.bqn b/src/r.bqn
index 7e8a7ec1..05245221 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -580,9 +580,10 @@ _repeat_←{
n←𝕨𝔾𝕩
l←u←0
{"⍟: Repetition numbers in 𝕨 must be integers"!Int𝕩⋄l↩lβŒŠπ•©β‹„u↩uβŒˆπ•©}βš‡0 n
- a←𝕩⋄_p←{π”½βˆ˜βŠ£`⟨aβŸ©βˆΎβ†•0+𝕩}
- pos←(𝕨𝔽 ⊒)_p u
- neg←(π•¨π”½βΌβŠ’)_p-l
+ b←𝕨{π•βŠ£}Λ™βŠ˜{𝕨˙{π”½π•βŠ£}}0
+ iβ†βŸ¨π•©βŸ©β‹„P←B⊸{π•Ž`iβˆΎβ†•π•©}
+ pos←𝕗 P u
+ neg←𝕗 Inverse⊸P -l
(|βŠ‘<⟜0βŠ‘posβ€ΏnegΛ™)βš‡0 n
}