From: Chris Gehlker Date: 2002-01-18T00:59:21+09:00 Subject: Re: Possible bug in Mac version? On 1/17/02 6:35 AM, "Dave Thomas" wrote: > > I was sent the following by Philippe de Rochambeau, but not having a > Mac I can't confirm it: > > > I would like to report a bug report for Ruby 1.6.6 on darwin (MacOSX > 10.1.2). > > The following program makes Ruby crash whenever you use the number > 400. > > # Save this as fact.rb > def fact(n) > if n == 0 > 1 > else > n * fact(n-1) > end > end > print fact(ARGV[0].to_i), "\n" > > > For instance, ruby fact.rb 40 works but ruby fact.rb 400 crashes Ruby. > I'm seeing that this works fine though n = 51. At n = 52 it just hangs. Then when I type ^C it says "Illegal instruction". Like so: > [dslstat473:~/Documents/Projects] chrisg% ruby fact.rb 51 > 1551118753287382280224243016469303211063259720016986112000000000000 > [dslstat473:~/Documents/Projects] chrisg% ruby fact.rb 52 > ^CIllegal instruction > [dslstat473:~/Documents/Projects] chrisg% Note: "Normal Ruby programs say "Interrupted" when I ^C them while they are running. -- C++: The power, elegance and simplicity of a hand grenade.