From: "Brett I. Holcomb" <brettholcomb@bellsouth.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Getting BC not to truncate at the decimal point?
Date: Wed, 24 May 2006 20:51:32 -0400 [thread overview]
Message-ID: <200605242051.32646.brettholcomb@bellsouth.net> (raw)
In-Reply-To: <e1a7ee0c0605241415h18e53e39of5abffee08848f3a@mail.gmail.com>
You're welcome. Don't feel bad - it took me a "This thing can't be that dumb"
and a man page read to find out it was smarter than I thought <G>.
On Wednesday May 24 2006 17:15, Mike Huber wrote:
> duh, sorry, case of me not fully reading the manpage. I'll be sure and
> fully read before I send to the list.
>
> Thanks a lot,
> --Mike
>
> On 5/24/06, brettholcomb@bellsouth.net <brettholcomb@bellsouth.net> wrote:
> > Did you try
> >
> > scale=n
> >
> > Where n is the number of digits after the decimal? More in man bc.
> >
> > > From: "Mike Huber" <michael.huber@gmail.com>
> > > Date: 2006/05/24 Wed PM 12:48:29 EDT
> > > To: gentoo-user@lists.gentoo.org
> > > Subject: [gentoo-user] Getting BC not to truncate at the decimal point?
> > >
> > > Hi,
> > > I'm just trying to do some quick calculations using bc, but the
> >
> > version
> >
> > > installed through portage truncates on multiplication/division. It
> >
> > didn't
> >
> > > used to do this 2 years ago when I was taking number theory, and there
> >
> > are
> >
> > > no USE flags available for sys-devel/bc to change this. From the
> >
> > manpage:
> > > ---------------------------------------------------------------------
> > >
> > > The most basic element in bc is the number. 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. (This version truncates results from divide and
> > > multiply operations.) There are two attributes of numbers, the length
> >
> > and
> >
> > > the scale. The length is the total number of
> >
> > significant decimal digits
> >
> > > in a number and the scale is the total number of decimal digits after
> >
> > the
> >
> > > decimal point. For example:
> > > .000001 has a length of 6 and scale of 6.
> > > 1935.000 has a length of 7 and a scale of 3.
> > >
> > >
> > > -----------------------------------------------------------------------
> > >-
> > >
> > >
> > > Anyone have any ideas?
> > >
> > > --Mike
> >
> > --
> > gentoo-user@gentoo.org mailing list
--
Brett I. Holcomb
--
gentoo-user@gentoo.org mailing list
next prev parent reply other threads:[~2006-05-25 0:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 20:46 [gentoo-user] Getting BC not to truncate at the decimal point? brettholcomb
2006-05-24 21:15 ` Mike Huber
2006-05-25 0:51 ` Brett I. Holcomb [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-05-24 16:48 Mike Huber
2006-05-25 16:05 ` John Green
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605242051.32646.brettholcomb@bellsouth.net \
--to=brettholcomb@bellsouth.net \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox