Quantcast
Channel: Gwynne's Blog » optimization
Viewing all articles
Browse latest Browse all 5

Floating-point makes my brain melt

$
0
0
Sometimes it’s better to do the obvious than try to be “correct”. How would you check if a floating-point variable x was zero? Common sense says x == 0.0 should work, right? But the compiler gets cranky about floating-point compares, yet zero is certainly a valid sentinel value even for floating-point. So I found the [...]

Viewing all articles
Browse latest Browse all 5

Trending Articles