Talk:Real

From Valve Developer Community
Revision as of 22:48, 14 July 2005 by MightyMooquack (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The downside to using reals is that real variables use more space than integer variables

This is not strictly true. A float is usually the same size as an int (usually 32 bits), and a double is usually twice that size and the same size as a long, though of course actual sizes are not guaranteed. The real downside to using floating-point variables is that rounding errors can make them inaccurate, which means testing a floating-point variable for strict equality with something else (either floating-point or integral) is a bad idea. —MightyMooquack 22:48, 14 Jul 2005 (PDT)