testing: fix rounding error in roundDown10
Fixes issue 5599.
Thanks to minux.ma for the suggested fix.
As we now have a harness to test testing internal functions I added some coverage for testing.roundUp, as it is the main consumer of roundDown10.
On Sat, Jun 1, 2013 at 10:17 AM, <kr@xph.us> wrote: > Should roundUp and roundDown10 ...
10 years, 11 months ago
(2013-06-01 02:23:46 UTC)
#5
On Sat, Jun 1, 2013 at 10:17 AM, <kr@xph.us> wrote:
> Should roundUp and roundDown10 return n if n
> is already of the desired form? Doesn't seem
> important one way or the other, but they should
> at least be consistent.
>
if we decide to do this, we should fix the docs (the docs is not clear
about this corner case
in roundDown10 (i'm assuming that the "down" there means the output should
always < input).
No, "round down" means "round to the nearest integer, downwards if necessary." If you round ...
10 years, 11 months ago
(2013-06-01 03:07:55 UTC)
#6
No, "round down" means "round to the nearest integer, downwards if
necessary." If you round down 2.1, you get 2; if you round down 2,
you still get 2 because it's already rounded down.
-rob
On 2013/06/01 03:07:55, r wrote: > No, "round down" means "round to the nearest integer, ...
10 years, 11 months ago
(2013-06-01 04:35:32 UTC)
#7
On 2013/06/01 03:07:55, r wrote:
> No, "round down" means "round to the nearest integer, downwards if
> necessary." If you round down 2.1, you get 2; if you round down 2,
> you still get 2 because it's already rounded down.
>
> -rob
PTAL. Thanks to r and minux for clarification. There was a mistake in my
original test data.
I've reverted to khr's fix in 9915045 (with permission).
Please observe the latest change to the roundUp test.
*** Submitted as https://code.google.com/p/go/source/detail?r=a115231d557b *** testing: fix rounding error in roundDown10 Fixes issue 5599. Thanks ...
10 years, 11 months ago
(2013-06-01 23:13:33 UTC)
#12
*** Submitted as https://code.google.com/p/go/source/detail?r=a115231d557b ***
testing: fix rounding error in roundDown10
Fixes issue 5599.
Thanks to minux.ma for the suggested fix.
As we now have a harness to test testing internal functions I added some
coverage for testing.roundUp, as it is the main consumer of roundDown10.
R=minux.ma, kr, r
CC=golang-dev
https://codereview.appspot.com/9926043
Issue 9926043: code review 9926043: testing: fix rounding error in roundDown10
(Closed)
Created 10 years, 11 months ago by dave_cheney.net
Modified 10 years, 11 months ago
Reviewers:
Base URL:
Comments: 6