Talk:Real: Difference between revisions
No edit summary |
InvaderZim (talk | contribs) mNo edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
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''. —[[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''. —[[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) | |||
I think this page could use some help, for numbers with no decimal part (to quote the article "health") I really don't see the argument that float would be better than an int. And the part about higher accuracy is actually a bit misleading considering natural rounding errors --[[user:InvaderZim | InvaderZim]] |
Latest revision as of 15:02, 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)
I think this page could use some help, for numbers with no decimal part (to quote the article "health") I really don't see the argument that float would be better than an int. And the part about higher accuracy is actually a bit misleading considering natural rounding errors -- InvaderZim