This is not much different. I is the same as const c = 0.3 - 0.1*3
func BenchmarkUntypedConstants(b *testing.B) { b.Log(0.3 - 0.1*3) for i := 0; i < b.N; i++ { z = c } } On Sun, 2018-09-02 at 20:25 -0700, José Colón wrote: > Yeah, after posting I realized that the compiler would probably be > smart > enough to optimize that out, so I changed them to: > > func BenchmarkUntypedConstants(b *testing.B) { > var z float64 > for i := 0; i < b.N; i++ { > z = 0.3 - 0.1*3 > } > b.Log(z) > } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.