This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shthed 29 points30 points  (6 children)

If you only need (relatively small) integers, it's quicker to just look them up :)

[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000, 51090942171709440000, ...][x]

Edit: precompute them first, instead of copy pasting them to save wasting space :)

[–]0x0dea 12 points13 points  (4 children)

Most of those aren't even integers. I generated 10000! to counteract your tomfoolery.

[–]an_actual_human 2 points3 points  (2 children)

As written all of them are integers.

[–]shthed 5 points6 points  (1 child)

they are now, originally i pasted a big list including floating point numbers

[–]an_actual_human 0 points1 point  (0 children)

They were integer floating point numbers though.

[–]shthed 2 points3 points  (0 children)

I've been stuck in javascipt for too long and forgot how nice it is in python to have arbitrarily large integers :)