0

When I try to calculate something like 599! in Matlab, the answer is inf and not useful, but I am able to do that fine in python in google collab. Even when I try using stirling approximation for these large factorials I still get inf as an answer and I can't do anything with that (I'm trying to calculate multiplicity).

Why is it this way, especially since google collab isn't even on my computer its in the cloud or whatever. Can someone explain how this is possible?

max
  • 101
  • 2

1 Answers1

1

Very simply, MATLAB has a hard limit on the size of integers and floats, and returns inf when you pass that value. Python implements a long-integer mode, an unlimited digital mode for computation. When you pass the "normal" 64-bit limit, Python converts to that long integer mode and continues operation -- at a very reduced speed.

Prune
  • 76,765
  • 14
  • 60
  • 81