P1822 - Sign of the Product of an Array
Solution | Link | |
---|---|---|
APL | ×/× |
Link |
Kap | ×/× |
|
TinyAPL | ×⍆⍤× |
|
J | */* |
|
BQN | ×´× |
|
Uiua | /×± |
|
Q | prd signum x |
|
Julia | sign.(x) |> prod |
|
MATLAB | prod(sign(x)) |
|
NumPy | np.prod(np.sign(x)) |
|
R | prod(sign(x)) |
|
Nial | product -[0 <,0 >] |
|
Futhark | x |> map i32.sgn |> i32.product |
|
Ivy | */ sgn x |
|
SaC | prod(max(min(x, 1), -1)) |
|
ArrayFire | af::product(af::max(af::min(x, 1.0), -1.0)) |
|
MatX | ➡️➡️ | Link |