Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- By default Go interpreter scientific notation to float64.
- This example shows how to use scientific notation to declare int types.
- This example also shows how to reuse the same parameter in Printf function.
- */
- package main
- import (
- "fmt"
- )
- const (
- kf = 1e3
- ki int = 1e3
- )
- func main() {
- fmt.Printf("ki v[%v] T[%[1]T]\n", ki)
- fmt.Printf("kf v[%v] T[%[1]T]\n", kf)
- }
- /*
- Output
- ki v[1000] T[int]
- kf v[1000] T[float64]
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement