Re:The 3n+1 problem
by Avshalom on Thursday October 25, 2012 @12:58PM
(#4698347)
Not knowing much about the internals of the interpreter (other than proper tco) I would assume just your old fashioned infinite loop unless it got into bignum territory and got too large for memory.
I'm sure you could use contracts to prevent the latter and reasonably sure there's some option somewhere to set maximum recursion depth to prevent the prior.
EDIT: as opposed to boring method of just putting/checking a loop count accumulator and if not bignum? into the function body.
I'm sure you could use contracts to prevent the latter and reasonably sure there's some option somewhere to set maximum recursion depth to prevent the prior.
EDIT: as opposed to boring method of just putting/checking a loop count accumulator and if not bignum? into the function body.