initial commit

This commit is contained in:
specCon18 2023-12-18 03:40:05 -05:00
commit 493ce92e02
62 changed files with 1213 additions and 0 deletions

BIN
constants/constants Executable file

Binary file not shown.

24
constants/constants.go Normal file
View file

@ -0,0 +1,24 @@
package main
import (
"fmt"
"math"
)
//const declares a constant value.
const s string = "constant"
func main(){
fmt.Println(s)
// A const statement can appear anywhere a var statement can.
const n = 500000000
// Constant expressions perform arithmetic with arbitrary precision.
const d = 3e20 / n
// A numeric constant has no type until its given one, such as by an explicit conversion.
fmt.Println(int64(d))
// A number can be given a type by using it
// in a context that requires one, such
// as a variable assignment or function call.
// For example, here math.Sin expects a float64.
fmt.Println(math.Sin(n))
}