From 9cdb8bd50240ba2b9251f61ad0b79c562f290556 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 29 Oct 2008 13:58:12 -0700 Subject: [PATCH] minor int/float fixes R=ken OCL=18032 CL=18032 --- test/float_lit.go | 6 +++--- test/utf.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/float_lit.go b/test/float_lit.go index 49a79452880..a78a6e92451 100644 --- a/test/float_lit.go +++ b/test/float_lit.go @@ -7,7 +7,7 @@ package main func -pow10(pow int) double +pow10(pow int) float64 { if pow < 0 { return 1/pow10(-pow); } if pow > 0 { return pow10(pow-1)*10; } @@ -15,9 +15,9 @@ pow10(pow int) double } func -close(da double, ia, ib int64, pow int) bool +close(da float64, ia, ib int64, pow int) bool { - db := double(ia) / double(ib); + db := float64(ia) / float64(ib); db *= pow10(pow); if da == 0 { diff --git a/test/utf.go b/test/utf.go index f38f4edd8c8..5905152b672 100644 --- a/test/utf.go +++ b/test/utf.go @@ -20,7 +20,7 @@ func main() { } var l = len(s); for w, i, j := 0,0,0; i < l; i += w { - var r int32; + var r int; r, w = sys.stringtorune(s, i); if w == 0 { panic("zero width in string") } if r != chars[j] { panic("wrong value from string") } @@ -43,7 +43,7 @@ func main() { a[10] = 0xaa; a[11] = 0x9e; for w, i, j := 0,0,0; i < L; i += w { - var r int32; + var r int; r, w = sys.bytestorune(&a[0], i, L); if w == 0 { panic("zero width in bytes") } if r != chars[j] { panic("wrong value from bytes") }