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

Re: bc



On Thu, Oct 31, 2002 at 08:37:00AM -0500, Oleg wrote:
> OK I would like to know how this monstrosity made it into Debian Stable:

Maybe you could consider relaxing a little and reading more carefully.

> $ whatis bc
> bc (1)               - An arbitrary precision calculator language
> $ bc
> bc 1.06
> Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
> This is free software with ABSOLUTELY NO WARRANTY.
> For details type `warranty'.
> 6.2/0.3
> 20
> 
> I have looked into the man page, and nothing there indicates this kind of 
> nonsense.

Sure it does. Search for 'scale' and read.

       There are four special  variables,  scale,  ibase,  obase,  and
       last.   scale  defines how some operations use digits after the
       decimal point.  The default value of  scale  is  0.

Also:

   MATH LIBRARY
       If  bc  is  invoked  with  the  -l  option,  a  math library is
       preloaded and the default  scale  is  set  to  20.

  $ bc
  bc 1.06
  Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
  This is free software with ABSOLUTELY NO WARRANTY.
  For details type `warranty'.
  6.2/0.3
  20
  scale=4
  6.2/0.3
  20.6666

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: