12. Floats
Float Type
float types are used to represent numbers with decimal value.
Go provides two sizes of floating-point numbers,
float32
andfloat64
.
main.go
Declaring Floats
Floats are declared using one of the following ways:
main.go
If we are not specifying type like in 3rd and 4th declaration, it will default to float64
Zero value for float is 0.0
Last updated