Jump to content

Talk:Sequence of non-squares: Difference between revisions

Line 61:
Is there a reason that the task states (and most people implement) <tt>floor(1/2 + ...)</tt> instead of simply <tt>round(...)</tt>?
[[User:Sgeier|Sgeier]] 20:18, 28 September 2009 (UTC)
 
In some programming languages round may give different results. E. g. in Scheme: "Round returns the closest integer to x, ''rounding to even when x is halfway between two integers''. Rationale: Round rounds to even for consistency with the default rounding mode specified by the IEEE floating point standard." But since we are only rounding the square roots of integers, in this case we would not run into problems like these. Maybe it's because [http://en.wikipedia.org/wiki/Floor_function floor] has been well-defined in mathematics and [http://en.wikipedia.org/wiki/Rounding round] hasn't. [[Special:Contributions/131.155.116.18|131.155.116.18]] 17:09, 30 November 2009 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.