[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unexpected calculation result with Lua53
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 4 May 2015 12:56:45 -0300
I must confess I learned something new from this discution. From now
one, whenever I teach the factorial function in C, I will write it like
this:
double fact (double n) {
double a = 1;
while (n > 0) a *= n--;
return a;
}
After all, it gives "better" results then the old-fashined version :-)
-- Roberto