accept non-array args to •internal.Squeeze

and also float replicate
This commit is contained in:
dzaima 2021-05-31 22:54:37 +03:00
parent 36a27b8424
commit 10e8339012
2 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,7 @@ B refc_c1(B t, B x) {
return r;
}
B squeeze_c1(B t, B x) {
if (!isArr(x)) return x;
return bqn_squeeze(x);
}
B isPure_c1(B t, B x) {

View File

@ -242,6 +242,17 @@ B slash_c2(B t, B w, B x) {
}
dec(w); dec(x);
return r;
} else if (TI(x).elType==el_f64) {
f64* xp = f64any_ptr(x);
f64* rp; B r = m_f64arrv(&rp, ria);
for (usz i = 0; i < wia; i++) {
i32 c = wp[i];
if (c<0) thrF("/: 𝕨 must consist of natural numbers (%i∊𝕨)", c);
f64 cx = xp[i];
for (usz j = 0; j < c; j++) *rp++ = cx;
}
dec(w); dec(x);
return r;
} else {
HArr_p r = m_harrs(ria, &ri);
BS2B xgetU = TI(x).getU;