3 ms·
> Not in Go. Yes in go. `var u = 1e7` gives a float. That means 1e7 is a float literal. You can coerce it to an integer by explicitly typing the target, but it
by masklinn 7y ago
> Not in Go.
Yes in go. `var u = 1e7` gives a float. That means 1e7 is a float literal. You can coerce it to an integer by explicitly typing the target, but it's still a float literal.
- yencabulator 7y ago`1e7` is an untyped numeric constant with a default type of float64. https://blog.golang.org/constants https://blog.golang.org/constants https://golang.org/ref/spec#Constants https://golang.org/ref/spec#Constants