Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. /*
  2. By default Go interpreter scientific notation to float64.
  3. This example shows how to use scientific notation to declare int types.
  4. This example also shows how to reuse the same parameter in Printf function.
  5. */
  6.  
  7. package main
  8.  
  9. import (
  10. "fmt"
  11. )
  12.  
  13. const (
  14. kf = 1e3
  15. ki int = 1e3
  16. )
  17.  
  18. func main() {
  19. fmt.Printf("ki v[%v] T[%[1]T]\n", ki)
  20. fmt.Printf("kf v[%v] T[%[1]T]\n", kf)
  21. }
  22.  
  23. /*
  24. Output
  25.  
  26. ki v[1000] T[int]
  27. kf v[1000] T[float64]
  28. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement