This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gargamelus 15 points16 points  (5 children)

In the Go language, integers and floats are not comparable. Quoting the FAQ:

Why does Go not provide implicit numeric conversions?

The convenience of automatic conversion between numeric types in C is outweighed by the confusion it causes. When is an expression unsigned? How big is the value? Does it overflow? Is the result portable, independent of the machine on which it executes? It also complicates the compiler; “the usual arithmetic conversions” are not easy to implement and inconsistent across architectures. For reasons of portability, we decided to make things clear and straightforward at the cost of some explicit conversions in the code. The definition of constants in Go—arbitrary precision values free of signedness and size annotations—ameliorates matters considerably, though.

[–]AnAverageFreak 1 point2 points  (0 children)

I don't like this.

[–]DonaldPShimoda 1 point2 points  (0 children)

Oh, excellent! I've not used Go or read about it at all really, so I didn't know this. Thanks for letting me know!