float32 -> float64

This commit is contained in:
sm
2014-04-26 15:36:04 -07:00
parent db28bfea11
commit 8f7ef5aa1a
8 changed files with 83 additions and 82 deletions
+11 -10
View File
@@ -15,14 +15,15 @@ import (
// ways (json POSTed to server, config file, constants) and are typically owned
// by a Controller.
type Config struct {
Tick int `json:"tick"` // ms
Timescale float32 `json:"timescale"`
Delta float32 `json:"delta"`
Width int `json:"width"`
Height int `json:"height"`
ObstacleCount int `json:"obstacle_count"`
MaxPoints int `json:"max_points"`
Mode string `json:"mode"`
Tick int `json:"tick"` // ms
Timescale float64 `json:"timescale"`
Delta float64 `json:"delta"`
Width int `json:"width"`
Height int `json:"height"`
ObstacleCount int `json:"obstacle_count"`
Obstacles []Obstacle `json:'obstacles'`
MaxPoints int `json:"max_points"`
Mode string `json:"mode"`
}
const (
@@ -69,7 +70,7 @@ func LoadConfig(filename string) (Config, error) {
return c, errors.New(fmt.Sprintf("config parse error: %s", err))
}
}
c.Delta = (float32(c.Tick) / 1000.0) * float32(c.Timescale)
log.Printf("final config: %+v", c)
c.Delta = float64(c.Tick) / 1000.0 * c.Timescale
log.Printf("final config: %#v", c)
return c, nil
}