Post Reply 
Recursion on the new Casio fx-CG500
08-13-2017, 12:54 PM
Post: #1
Recursion on the new Casio fx-CG500
I was playing with the Casio fx-CG500 and wrote a recursive program that calculate factorials. I was a bit surprised that it failed to do 10! ... the machine displays an out-of-memory error message. I think I was able to go up to the factorial of 7. This is a disappointing limitation for a machine with 500KB RAM!
Find all posts by this user
Quote this message in a reply
08-13-2017, 10:16 PM
Post: #2
RE: Recursion on the new Casio fx-CG500
(08-13-2017 12:54 PM)Namir Wrote:  I was playing with the Casio fx-CG500 and wrote a recursive program that calculate factorials. I was a bit surprised that it failed to do 10! ... the machine displays an out-of-memory error message. I think I was able to go up to the factorial of 7. This is a disappointing limitation for a machine with 500KB RAM!

Most likely, there's a fixed-size return stack that gets filled long before all of memory gets filled. That's unlike a PC where the return stack is limited only by the size of free memory.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
08-14-2017, 08:23 AM
Post: #3
RE: Recursion on the new Casio fx-CG500
Makes sense!

Namir
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)