Skip to content

Instantly share code, notes, and snippets.

@inancgumus
Created October 2, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inancgumus/37ca5dd0f80b7c30078b5a85ecb145b6 to your computer and use it in GitHub Desktop.
Save inancgumus/37ca5dd0f80b7c30078b5a85ecb145b6 to your computer and use it in GitHub Desktop.
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