]> Cypherpunks repositories - gostls13.git/commitdiff
time: change float expression to ensure it is an integer
authorIan Lance Taylor <iant@golang.org>
Mon, 23 Apr 2012 22:46:54 +0000 (15:46 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 23 Apr 2012 22:46:54 +0000 (15:46 -0700)
When I increased the number of bits that gccgo uses for
untyped floats, the expression 0.52*1e9 was no longer
integral.  This patch fixes that.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6113043

src/pkg/time/time_test.go

index 28047804e09668b4d6396fe915662a92d9a52bb5..c48e0a4300c6f050151e7d80216c6045ea3be0c9 100644 (file)
@@ -805,7 +805,7 @@ var jsonTests = []struct {
        time Time
        json string
 }{
-       {Date(9999, 4, 12, 23, 20, 50, .52*1e9, UTC), `"9999-04-12T23:20:50.52Z"`},
+       {Date(9999, 4, 12, 23, 20, 50, 520*1e6, UTC), `"9999-04-12T23:20:50.52Z"`},
        {Date(1996, 12, 19, 16, 39, 57, 0, Local), `"1996-12-19T16:39:57-08:00"`},
        {Date(0, 1, 1, 0, 0, 0, 1, FixedZone("", 1*60)), `"0000-01-01T00:00:00.000000001+00:01"`},
 }