3 ms·
Go's floating point support is sort of FUBAR. For example, these three equivalent snippets all produce different results: 1. fmt.Printf("%f", 1.0 / -0.0); 2.
by millstone 13y ago
Go's floating point support is sort of FUBAR. For example, these three equivalent snippets all produce different results:
1. fmt.Printf("%f", 1.0 / -0.0);
2. x := -0.0; fmt.Printf("%f", 1.0 / x);
3. x := 0.0; fmt.Printf("%f", 1.0 / -x);