Created
October 2, 2017 18:46
-
-
Save inancgumus/37ca5dd0f80b7c30078b5a85ecb145b6 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" | |
) | |
func main() { | |
// if it was: 14000000000 it'll overflow int on 32-bit machines | |
// using the scientific notation 14e9, elects the variable's type as | |
// a float64. because, the scientific-notation is defined for floating nums | |
ageOfUniverse := 14e9 | |
// %0.f removes the decimals, shows it as an integer | |
fmt.Printf("`ageOfUniverse` is %0.f.\n", ageOfUniverse) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment