Re: C++ Compiling Problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 23, 2005 at 08:45:19AM -0600, linux user wrote:
> > C doesn't do fixed-point.
> I don't know what is meant by this.  If it means floating point, again this
> is incorrect.  C is capable of performing computations with integers,
> floats, and doubles.  What else is there?

Fixed point is a "lossless" way to represent decimal fractions. Standard
floating-point uses binary internally, and so "0.01" can't actually be
 represented properly (just as 1/3 can't be represented completely in
decimal -- 0.33333...). Fixed point is generally implemented by using
integers and keeping track of where a decimal point ought to be. (Addition
is straightforward, multiplication/division gets an extra step.)

It's also not in the C++ standard library, as far as I know.

-- 
Matthew Miller           mattdm@xxxxxxxxxx        <http://www.mattdm.org/>
Boston University Linux      ------>                <http://linux.bu.edu/>
Current office temperature: 72 degrees Fahrenheit.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux