Re: fixed point, floating point
Posted in 1993
Topics: Performance & Tuning
In article <1993Nov7.061017.18597@leland.Stanford.EDU> bolguin@leland.Stanford.EDU (Ben Olguin) writes: | Would someone mind explaining to me what's the difference between | fixed point and floating point (sorry, I'm not a CS major :)) Floating point: has a magnitude and some number of digits of precision. This implies that while large numbers may print 25 digits, only the first N (often 9 or 18) are accurate. A floating point number is often and approximation, but it's useful because of the range, typically 10^38 to 10^-38 or so. Integer: represents only "whole number values" and does so exactly. When a number can't be represented exactly because it's too large or small, it's not represented at all. Fixed point: is rarely used, many people think it means the same as integer. A fixed point number has a fixed number of bits for the value greater then one, like an integer, and also some bits which represent a fractional part. On many entry level computers, such as Macs and PCs, floating point arithmetic is much slower than integer. Fixed point is usually done in software rahter than hardware, and is used at times to overcome the performance limitations of these systems. On most systems, unless vector calculations are used, the integer arithmetic is faster then floating point. There are exceptions, but you probably don't have one on your desktop. -- Bill Davidsen, davidsen@tmr.com | C programming, PC based UNIX, data TMR Associates, +1 518-370-5654 | acquisition, device drivers. _____________________________________|______________________________________ I can see clearly now, the brain is gone. I can see all popsicles in my way