On April 06 2008 12:30 Vin{MBL} wrote:
hahaha nice!
Why did you use 1.0 and 3.0 instead of just 3 and 1 though?
hahaha nice!
Why did you use 1.0 and 3.0 instead of just 3 and 1 though?
Because 1 / 3 = 0 (due to integer <strike>rounding</strike> truncation)
I guess I could have just used 1 / n and had n be 3.0 or used 1.0 / n and just had n be an integer, but if you have both n = 3 and 1 / n, then the parens part will turn out to be 0 each iteration.
Edit: changed rounding to truncation to be more accurate about what the comp does.