fix •math.LCM on arrays

This commit is contained in:
dzaima 2024-12-13 07:37:08 +02:00
parent 5ecd1858ef
commit d1a9669e76
2 changed files with 4 additions and 3 deletions

View File

@ -521,8 +521,8 @@ B lcm_c2(B t, B w, B x) {
if (!q_u64(w) || !q_u64(x)) thrM("•math.LCM: Inputs other than natural numbers not yet supported");
return m_f64(lcm_u64(o2u64G(w), o2u64G(x)));
}
P2(gcd)
thrM("•math.GCD: Unexpected argument types");
P2(lcm)
thrM("•math.LCM: Unexpected argument types");
}
#undef P2

View File

@ -260,9 +260,10 @@ E←•internal.EEqual ⋄ {! (𝕏 4⥊0) E 𝕏 1↓¯1×π∾4⥊0}¨ (⊢∾
{15 𝕏 10}¨ •math.GCD,•math.LCM %% 530
1e5×{0.1 𝕏 0.2}¨ •math.Atan2,•math.Comb,•math.Hypot,•math.Atan2,•math.Atan2˜ %% 1107149695922360202749331
1e5×{=˜99¨ 𝕏 0.13}¨ •math.Acos,•math.Acosh,•math.Asin,•math.Asinh,•math.Atan,•math.Atanh,•math.Cbrt,•math.Cos,•math.Cosh,•math.Erf,•math.ErfC,•math.Expm1,•math.Fact,•math.Log10,•math.Log1p,•math.Log2,•math.LogFact,•math.Sin,•math.Sinh,•math.Tan,•math.Tanh %% 1470629900000,9900000176274,100169900000,9983181844,9966124904,100339900000,46415144224,99500¯99000,1005001006766,1124699997,887532,105171908553,95135600000,¯10000047712,9531138629,¯332193158496,¯4988179175,998314112,100161001787,10033¯14255,996699505
{𝕩 ! 12 (𝕏 𝕏¨) 34}¨ •math.Atan2,•math.Comb,•math.Hypot,•math.Atan2,•math.Atan2˜,•math.GCD,•math.LCM
!"•math.GCD: Inputs other than natural numbers not yet supported" % 1.5 •math.GCD 3
!"•math.LCM: Inputs other than natural numbers not yet supported" % 3 •math.LCM 1.5
!"•math.GCD: Unexpected argument types" % "foo" •math.LCM 3
!"•math.LCM: Unexpected argument types" % "foo" •math.LCM 3
!"•math.GCD: Unexpected argument types" % 3 •math.GCD {+}
!"•math.Sin: Argument contained non-number" % •math.Sin "foo"
!"•math.Log10: Argument contained non-number" % •math.Log10 "foo"