Talk:Real: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 2: Line 2:


This is not strictly true. A <tt>float</tt> is ''usually'' the same size as an <tt>int</tt> (''usually'' 32 bits), and a <tt>double</tt> is usually twice that size and the same size as a <tt>long</tt>, 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''. &mdash;[[User:MightyMooquack|MightyMooquack]] 22:48, 14 Jul 2005 (PDT)
This is not strictly true. A <tt>float</tt> is ''usually'' the same size as an <tt>int</tt> (''usually'' 32 bits), and a <tt>double</tt> is usually twice that size and the same size as a <tt>long</tt>, 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''. &mdash;[[User:MightyMooquack|MightyMooquack]] 22:48, 14 Jul 2005 (PDT)
Is there any reason this is a stub? It seams pretty much complete to me--[[User:Pon|Pon]] 05:54, 6 Aug 2005 (PDT)

Revision as of 05:54, 6 August 2005

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)


Is there any reason this is a stub? It seams pretty much complete to me--Pon 05:54, 6 Aug 2005 (PDT)