add 𝕨/𝕩 in dyadic ⌽/⌽⁼ error message
This commit is contained in:
parent
bdee96a995
commit
9826c4ce0e
@ -1186,7 +1186,7 @@ B reverse_c2(B t, B w, B x);
|
||||
#define WRAP_ROT(V, L) ({ i64 v_ = (V); usz l_ = (L); if ((u64)v_ >= (u64)l_) { v_%= (i64)l_; if(v_<0) v_+= l_; } v_; })
|
||||
NOINLINE B rotate_highrank(bool inv, B w, B x) {
|
||||
#define INV (inv? "⁼" : "")
|
||||
if (RNK(w)>1) thrF("⌽%U: 𝕨 must have rank at most 1 (%H ≡ ≢𝕨)", INV, w);
|
||||
if (RNK(w)>1) thrF("𝕨⌽%U𝕩: 𝕨 must have rank at most 1 (%H ≡ ≢𝕨)", INV, w);
|
||||
B r;
|
||||
usz wia = IA(w);
|
||||
if (isAtm(x) || RNK(x)==0) {
|
||||
@ -1207,7 +1207,7 @@ NOINLINE B rotate_highrank(bool inv, B w, B x) {
|
||||
if (wia==0) { r=x; goto decW_ret; }
|
||||
if (!elNum(TI(w,elType))) {
|
||||
w = num_squeeze(w);
|
||||
if (!elNum(TI(w,elType))) thrF("⌽%U: 𝕨 contained non-number", INV);
|
||||
if (!elNum(TI(w,elType))) thrF("𝕨⌽%U𝕩: 𝕨 contained non-number", INV);
|
||||
}
|
||||
bool origF64 = TI(w,elType)==el_f64;
|
||||
w = toF64Any(w);
|
||||
@ -1277,7 +1277,7 @@ NOINLINE B rotate_highrank(bool inv, B w, B x) {
|
||||
|
||||
decW_ret: decG(w);
|
||||
return r;
|
||||
badlen: thrF("⌽%U: Length of list 𝕨 must be at most rank of 𝕩 (%s ≡ ≠𝕨, %H ≡ ≢𝕩⟩", INV, wia, x);
|
||||
badlen: thrF("𝕨⌽%U𝕩: Length of list 𝕨 must be at most rank of 𝕩 (%s ≡ ≠𝕨, %H ≡ ≢𝕩⟩", INV, wia, x);
|
||||
#undef INV
|
||||
}
|
||||
B reverse_c2(B t, B w, B x) {
|
||||
@ -1505,9 +1505,9 @@ B shape_ucw(B t, B o, B w, B x) {
|
||||
|
||||
|
||||
B reverse_ix(B t, B w, B x) {
|
||||
if (isAtm(x) || RNK(x)==0) thrM("⌽⁼: 𝕩 must have rank at least 1");
|
||||
if (isAtm(x) || RNK(x)==0) thrM("𝕨⌽⁼𝕩: 𝕩 must have rank at least 1");
|
||||
if (isF64(w)) return C2(reverse, m_f64(-o2fG(w)), x);
|
||||
if (isAtm(w)) thrM("⌽⁼: 𝕨 must consist of integers");
|
||||
if (isAtm(w)) thrM("𝕨⌽⁼𝕩: 𝕨 must consist of integers");
|
||||
return rotate_highrank(1, w, x);
|
||||
}
|
||||
|
||||
|
||||
@ -271,9 +271,19 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
|
||||
!"Expected integer, got NaN" % %USE eqerr ⋄ ⟨0÷0, ⟨0÷0⟩⟩ ⌽_eqerr ⟨↕10, ↕0, 0‿0⥊0, ⟨⟩⟩
|
||||
!"Integer out of range: ∞" % %USE eqerr ⋄ ⟨∞, ⟨∞⟩⟩ ⌽_eqerr ⟨↕10, ↕0, 0‿0⥊0, ⟨⟩⟩
|
||||
!"Expected integer, got function" % %USE eqerr ⋄ ⟨⊑ ⟩ ⌽_eqerr ⟨↕10, ↕0, 0‿0⥊0, ⟨⟩⟩
|
||||
!"Expected integer, got character" % %USE eqerr ⋄ ⟨'a'⟩ ⌽_eqerr ⟨↕10, ↕0, 0‿0⥊0, ⟨⟩⟩
|
||||
!"⌽: 𝕨 contained non-number" % %USE eqerr ⋄ ⟨3‿'a', 'a'‿3, 0‿'a', 'a'‿0⟩ ⌽_eqerr ⟨0‿0⥊0,0‿0‿0⥊0⟩
|
||||
!"Expected integer, got character" % %USE eqerr ⋄ ⟨'a'⟩ ⌽ _eqerr ⟨↕10, ↕0, 0‿0⥊0, ⟨⟩⟩
|
||||
!"𝕨⌽⁼𝕩: 𝕨 must consist of integers" % %USE eqerr ⋄ ⟨'a'⟩ ⌽⁼_eqerr ⟨↕10, ↕0, 0‿0⥊0, ⟨⟩⟩
|
||||
!"𝕨⌽𝕩: 𝕨 contained non-number" % %USE eqerr ⋄ ⟨3‿'a', 'a'‿3, 0‿'a', 'a'‿0⟩ ⌽ _eqerr ⟨0‿0⥊0,0‿0‿0⥊0⟩
|
||||
!"𝕨⌽⁼𝕩: 𝕨 contained non-number" % %USE eqerr ⋄ ⟨3‿'a', 'a'‿3, 0‿'a', 'a'‿0⟩ ⌽⁼_eqerr ⟨0‿0⥊0,0‿0‿0⥊0⟩
|
||||
!"Integer out of range: ∞" % %USE eqerr ⋄ ⟨3‿∞, ∞‿3, 0‿∞, ∞‿0⟩ ⌽_eqerr ⟨0‿0⥊0,0‿0‿0⥊0⟩
|
||||
!"𝕨⌽𝕩: 𝕨 must have rank at most 1 (1‿1 ≡ ≢𝕨)" % %USE eqerr ⋄ ⟨≍⋈1⟩ ⌽ _eqerr ⟨2‿2⥊1, ↕1⟩
|
||||
!"𝕨⌽⁼𝕩: 𝕨 must have rank at most 1 (1‿1 ≡ ≢𝕨)" % %USE eqerr ⋄ ⟨≍⋈1⟩ ⌽⁼_eqerr ⟨2‿2⥊1, ↕1⟩
|
||||
!"𝕨⌽𝕩: Length of list 𝕨 must be at most rank of 𝕩 (3 ≡ ≠𝕨, ⟨⟩ ≡ ≢𝕩⟩" % 1‿2‿3 ⌽ 1
|
||||
!"𝕨⌽⁼𝕩: 𝕩 must have rank at least 1" % 1‿2‿3 ⌽⁼ 1
|
||||
!"𝕨⌽𝕩: Length of list 𝕨 must be at most rank of 𝕩 (3 ≡ ≠𝕨, ⟨3⟩ ≡ ≢𝕩⟩" % 1‿2‿3 ⌽ ↕3
|
||||
!"𝕨⌽⁼𝕩: 𝕩 must have rank at least 1" % ⟨⟩ ⌽⁼ 1
|
||||
(<⁼ ⟨⟩⌽{a⇐1‿2}).a %% 1‿2
|
||||
1‿2‿3 ⌽ 4‿4‿4‿4⥊↕256 %% F←{(4|𝕨+↕4)⊏𝕩} ⋄ 3 F⎉2 2 F˘ 1 F 4‿4‿4‿4⥊↕256
|
||||
(1+1e15) ⌽ ↕10 %% (1+↕9)∾0
|
||||
(-1+1e15) ⌽ ↕10 %% 9∾↕9
|
||||
|
||||
|
||||
@ -172,6 +172,6 @@ n←500 ⋄ a←↕n ⋄ i←(-n)+↕2×n ⋄ r←⌽(2×n)⥊a ⋄ ! (⌽a) ≡
|
||||
!"⋈⁼: Argument wasn't a length-1 list" % (<4)⌾⋈ 2
|
||||
|
||||
# k⊸⌽
|
||||
!"⌽⁼: 𝕩 must have rank at least 1" % 1⌾(2⊸⌽) ↕10
|
||||
!"𝕨⌽⁼𝕩: 𝕩 must have rank at least 1" % 1⌾(2⊸⌽) ↕10
|
||||
⊏⌾(2⊸⌽) 10‿10⥊↕100 %% 28‿29‿20‿21‿22‿23‿24‿25‿26‿27
|
||||
≍⌾(1‿2⊸⌽) 5‿5⥊↕25 %% 1‿5‿5⥊22‿23‿24‿20‿21‿2‿3‿4‿0‿1‿7‿8‿9‿5‿6‿12‿13‿14‿10‿11‿17‿18‿19‿15‿16
|
||||
|
||||
Loading…
Reference in New Issue
Block a user