Skip to content

Instantly share code, notes, and snippets.

@wchargin
Created June 6, 2025 05:55
Show Gist options
  • Save wchargin/35f11316852033dd770a4c06357880f0 to your computer and use it in GitHub Desktop.
Save wchargin/35f11316852033dd770a4c06357880f0 to your computer and use it in GitHub Desktop.
consts and transitivity in go
package main
import (
"fmt"
"math"
)
func main() {
f := math.SmallestNonzeroFloat64
fmt.Println(f == 5e-324)
fmt.Println(f == math.SmallestNonzeroFloat64)
fmt.Println(math.SmallestNonzeroFloat64 == 5e-324)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment