aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorerifan01 <eric.fang@arm.com>2017-11-28 03:38:03 +0000
committerRobert Griesemer <gri@golang.org>2018-04-17 03:17:22 +0000
commit6d5ebc70225aeb71a60061e5cf755c5852ac13da (patch)
tree4a91625e79af77a9df750988a248bb1a32c27557 /src/testing/testing.go
parenta2ffe3e625b05217e8d44dcda43138fc61390666 (diff)
downloadgo-6d5ebc70225aeb71a60061e5cf755c5852ac13da.tar.xz
math: add a testcase for Mod and Remainder respectively
One might try to implement the Mod or Remainder function with the expression x - TRUNC(x/y + 0.5)*y, but in fact this method is wrong, because the rounding of (x/y + 0.5) to initialize the argument of TRUNC may lose too much precision. However, the current test cases can not detect this error. This CL adds two test cases to prevent people from continuing to do such attempts. Change-Id: I6690f5cffb21bf8ae06a314b7a45cafff8bcee13 Reviewed-on: https://go-review.googlesource.com/84275 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/testing/testing.go')
0 files changed, 0 insertions, 0 deletions