From 51d9fa4fc3d763051a696335bc3aaaec4bc152e9 Mon Sep 17 00:00:00 2001 From: Fabio Montefuscolo Date: Mon, 11 Mar 2024 17:30:21 +0100 Subject: [PATCH] learning about golang constants --- src/04-constants.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/04-constants.go diff --git a/src/04-constants.go b/src/04-constants.go new file mode 100644 index 0000000..f9647ce --- /dev/null +++ b/src/04-constants.go @@ -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)) +}