Re: BASH question

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

 



Aaron Konstam kirjoitti viestissään (lähetysaika sunnuntai, 10. 
syyskuuta 2006 02:20):
> But if you know that bc and dc actually implement fixed point
> arithmetic routines ans can testify to that fact I will be
> interested to hear about it.

According to the POSIX definition of bc 
(http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html), 
it should behave as if it uses fixed-point decimal arithmetic, 
no matter what the actual implementation: "Internal computations 
shall be conducted as if in decimal, regardless of the input and 
output bases, to the specified number of decimal digits."

The documentation for GNU bc 
(http://www.gnu.org/software/bc/manual/html_mono/bc.html#SEC5) 
states:
"Numbers are arbitrary precision numbers. This precision is both 
in the integer part and the fractional part. All numbers are 
represented internally in decimal and all computation is done in 
decimal." ... "There are two attributes of numbers, the length 
and the scale."
In other words, it uses fixed-point decimal arithmetic.

-- 
 Markku Kolkka
 markku.kolkka@xxxxxx


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

  Powered by Linux