summaryrefslogtreecommitdiff
path: root/test/float_lit.go
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-06-12 21:48:56 -0700
committerKen Thompson <ken@golang.org>2008-06-12 21:48:56 -0700
commitc66ab23658bf76a61bd918b1f2f5de787e35e102 (patch)
treecee9dc10714116e5f3d3402d7cec03f4fe764079 /test/float_lit.go
parent35f0f5efb472a622c88afc186d5057009b9e8d75 (diff)
downloadgo-c66ab23658bf76a61bd918b1f2f5de787e35e102.tar.gz
better import/export
SVN=122584
Diffstat (limited to 'test/float_lit.go')
-rw-r--r--test/float_lit.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/float_lit.go b/test/float_lit.go
index b43ae58cc..e5e95e68e 100644
--- a/test/float_lit.go
+++ b/test/float_lit.go
@@ -18,7 +18,7 @@ func
close(da double, ia, ib int64, pow int) bool
{
db := double(ia) / double(ib);
- db = db*pow10(pow);
+ db *= pow10(pow);
if da == 0 {
if db == 0 {
@@ -27,17 +27,12 @@ close(da double, ia, ib int64, pow int) bool
return false;
}
- dd := da-db;
- if dd < 0 {
- dd = -dd;
- }
-
- de := da;
+ de := (da-db) /da;
if de < 0 {
de = -de;
}
- if de*1.0e-14 > dd {
+ if de < 1.0e-14 {
return true;
}
return false;