3 ms·
Go throws an exception with 1.0/0.0. Unless you specify the type as float64. Ok overall I'm wrong. But either way poor design from a usability standpoint and
by crimsonalucard 9y ago
Go throws an exception with 1.0/0.0. Unless you specify the type as float64.
Ok overall I'm wrong.
But either way poor design from a usability standpoint and from a consistency standpoint because ints don't do this.
- steveklabnik 9y agoYeah, floats and ints are just fundamentally different, especially when you're at the level of caring about how hardware deals with things. TIL about Go: Numeric constants represent exact values of arbitrary precision and do not overflow. Consequently, there are no constants denoting the IEEE-754 negative zero, infinity, and not-a-number values. https://golang.org/ref/spec https://golang.org/ref/spec
- reificator 9y agoYeah that's one of those things that I learn, and then forget, and then relearn, and forget... Would probably retain it better if I used Go as my primary language for a year or two.