How does the float arithmetic work in Go
Playground link
package main
import "fmt"
func main() {
    j := 1.021
    fmt.Println(j)
    k := j*1000
    fmt.Println(k)
    l := int(k)
    fmt.Println(l)
}
Output:
1.021
1020.9999999999999
1020
I was expecting 1021 to be printed, but I got 1020
 
    