learning about golang constants

This commit is contained in:
Fabio Montefuscolo 2024-03-11 17:30:21 +01:00
parent 772a43c21e
commit 51d9fa4fc3
Signed by: fabiomontefuscolo
GPG key ID: B98DA1C6A4DE48B5

19
src/04-constants.go Normal file
View file

@ -0,0 +1,19 @@
package main
import (
"fmt"
"math"
)
const s string = "this is a constant"
func main() {
fmt.Println(s)
const n = 500000000
const d = 3e20 / n
fmt.Println(d)
fmt.Println(int64(d))
fmt.Println(math.Sin(n))
}