aboutsummaryrefslogtreecommitdiff
path: root/src/r1.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-02 21:01:23 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-02 21:01:23 -0400
commit85e745dd832e5386bfa17e7c44e3192a1e8227ca (patch)
tree6f66054fcbbdf9f5876682631e680514345ecbe5 /src/r1.bqn
parent07d50a2aaf4ff2bd9487af08077de950275b264d (diff)
Slightly quicker test for natural numbers
Diffstat (limited to 'src/r1.bqn')
-rw-r--r--src/r1.bqn4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 160618c9..4c073ade 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -11,7 +11,7 @@ SetPrims ← {Decompose‿PrimInd ↩ 𝕩}
IsArray ← 0=Type
IsAtom ← 1≤Type
Int ← (1=Type)◶⟨0,⌊⊸=⟩
-Nat ← (1=Type)◶⟨0,0⊸≤×⌊⊸=⟩
+Nat ← (1=Type)◶⟨0,|∘⌊⊸=⟩
ToArray ← <⍟IsAtom
IsSimple ← 1×´IsAtom⌜
Deshape ← IsArray◶{𝕩Fill⟨𝕩⟩}‿⥊
@@ -304,7 +304,7 @@ RepInd←(2⌊=∘⊣)◶{
{e+↩r⋄1+𝕩}⍟{e=𝕨}˜`↕r×𝕩
}‿{
"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩" ! 𝕩=≠𝕨
- "𝕨/𝕩: Amounts to replicate must be natural numbers" ! 1×´(0⊸≤×⌊⊸=)⌜𝕨
+ "𝕨/𝕩: Amounts to replicate must be natural numbers" ! 1×´|∘⌊⊸=⌜𝕨
Ind 𝕨
}‿{
"𝕨/𝕩: Replication argument must have rank 0 or 1" ! 0˙