]> Cypherpunks repositories - gostls13.git/commitdiff
minor int/float fixes
authorRuss Cox <rsc@golang.org>
Wed, 29 Oct 2008 20:58:12 +0000 (13:58 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 29 Oct 2008 20:58:12 +0000 (13:58 -0700)
R=ken
OCL=18032
CL=18032

test/float_lit.go
test/utf.go

index 49a7945288063b9878bb636e12234af5a3c1dd1b..a78a6e924513c57ef03222d2a5f14a402417944f 100644 (file)
@@ -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 {
index f38f4edd8c868e688070a0ce0d9e8ce261388c68..5905152b6720137b26c88c5cc580ea1a6ba951df 100644 (file)
@@ -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") }