Bug #24095 | round() documentation should be clearified regarding "nearest integer" | ||
---|---|---|---|
Submitted: | 8 Nov 2006 17:42 | Modified: | 17 Jan 2007 20:15 |
Reporter: | Christian Hammers (Silver Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S4 (Feature request) |
Version: | 5.0 | OS: | |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[8 Nov 2006 17:42]
Christian Hammers
[10 Nov 2006 13:18]
Valeriy Kravchuk
Thank you for a reasonable documentation request.
[13 Jan 2007 4:57]
Christian Hammers
Hello Paul On 2007-01-12 Paul DuBois wrote: > Hi Christian, > > re: > > "Rounds the argument x to 0, or if specified, D decimal places." > > That looks ambiguious to me. What does it mean? You're right :) Better start the explanation of the round() function with: "Rounds the argument to D decimal places. The rounding algorithm depends on the type of X. D defaults to zero if not specified." Do you think that this is clearer? My point was that the first sentence "Rounds to the nearest integer" is just wrong as the first example "25E-1" is clearly not rounded to the "nearest" integer which would be "3": mysql> SELECT round(25E-1), round(2.5); +--------------+------------+ | round(25E-1) | round(2.5) | +--------------+------------+ | 2 | 3 | +--------------+------------+ (ok, technically it is of course correct as the floating point number is probably stored as something computing to 2.4999999999 but the user should better be encouraged to continue reading all of the documentation :)) bye, -christian-
[17 Jan 2007 20:15]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products. Yes, that's clearer. Thanks. I'll make the change.