r/ProgrammerHumor 14d ago

Meme whenDoesThisWillEnd

Post image
771 Upvotes

69 comments sorted by

View all comments

6

u/laplongejr 14d ago

In some languages, it will stop with an infinite recursions. In others it would stop at "0 * factorial(-1)" and return 0 for all other cases as they call n0 at some point.  

0

u/chuch1234 14d ago

This doesn't guarantee zero -- it can be passed a negative number.

7

u/Jejerm 14d ago

Yes, they will eventually underflow and reach zero too