RosettaCodeData/Task/Factorial/SuperCollider/factorial-1.sc

10 lines
221 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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);