4 ms·
As someone who doesn't typically have reason to use either -- is using floats rather than doubles actually common? I was under the impression this was pretty r
by Sniffnoy 15y ago
As someone who doesn't typically have reason to use either -- is using floats rather than doubles actually common? I was under the impression this was pretty rare.
- vilya 15y agoIt's not rare at all. A double takes up twice as much memory as a float and memory bandwidth is a precious commodity these days. If you have a lot of numbers (e.g. in 3D models or similar) and don't need the extra precision, using floats is an obvious choice.
- copper 15y agoOr when you're reading/writing a great deal of numerical data in a file.
- xedarius 15y agoMost video games use floats. This is because doubles will be emulated in software on some platforms, thus making them incredibly slow. The Unreal Engine, for example uses floats extensively.
- jensnockert 15y agoAlso, most modern x86 processors can perform single-precision operations twice as fast as double-precision, which helps (and saving memory bandwidth is good too.) On PPC/ARM, single-precision allows you to use Altivec/NEON, which can give significant performance boosts as well.