Hacker News new | ask | show | jobs
by crimsonalucard 3089 days 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.

1 comments

Yeah, 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

Yeah 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.