Re:There Are Only Four Billion Floats – So Test Them All
by nkurz on Tuesday January 28, 2014 @12:47AM
(#7135579)
That's OK wisdom unless you are aiming for high performance. I'd put it at about the same level as "Don't use C if something higher level will work." If you are hoping to gain from vectorization, or if you have enough of them to care about memory usage, single precision is twice as good, unless the extra precision of a double actually gains you something.
[ Parent
| on HN ]
Re:There Are Only Four Billion Floats – So Test Them All
by lelandbatey on Tuesday January 28, 2014 @03:44AM
(#7136072)
Once again, I fell into the trap of saying "you should often do x" while leaving off the "... Except when you shouldn't". The exact comment from the CS professor I have in mind was "Using doubles when doing realtime human facing calculations (such as a calculator) is the best way to go. However, floats have their uses, such as on systems where there isn't enough memory, or where a float fulfills the requirements."
but that's a bit much to type from a phone so I went for "use doubles". And now I'll never be so lazy with my comments again!