Created
February 15, 2016 21:40
-
-
Save porfirion/73608ab27aacd19d3f89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ("fmt"; "time") | |
func main() { | |
var distance float64 = 10.0 | |
var speed float64 = 3.0 | |
val := distance / speed * 1000000000 | |
duration := time.Duration(val) | |
fmt.Printf("%#v (%T)\n", val, val) | |
fmt.Printf("%#v (%T)\n", duration, duration) | |
fmt.Printf("%#v (%T)\n", duration.Seconds(), duration.Seconds()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment