RosettaCodeData/Task/Factorial/SuperCollider/factorial-1.sc
2023-07-01 13:44:08 -04:00

9 lines
221 B
Scala

f = { |n| (1..n).product };
f.(10);
// for numbers larger than 12, use 64 bit float
// instead of 32 bit integers, because the integer range is exceeded
// (1..n) returns an array of floats when n is a float
f.(20.0);