learning about golang constants
This commit is contained in:
parent
772a43c21e
commit
51d9fa4fc3
1 changed files with 19 additions and 0 deletions
19
src/04-constants.go
Normal file
19
src/04-constants.go
Normal 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))
|
||||
}
|
Loading…
Reference in a new issue