From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Fj0QT-0008Bc-EY for garchives@archives.gentoo.org; Wed, 24 May 2006 20:57:53 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.6/8.13.6) with SMTP id k4OKuleF004828; Wed, 24 May 2006 20:56:47 GMT Received: from imf22aec.mail.bellsouth.net (imf22aec.mail.bellsouth.net [205.152.59.70]) by robin.gentoo.org (8.13.6/8.13.6) with ESMTP id k4OKkQpZ011442 for ; Wed, 24 May 2006 20:46:26 GMT Received: from ibm67aec.bellsouth.net ([192.168.16.253]) by imf22aec.mail.bellsouth.net with ESMTP id <20060524204625.MXLN28417.imf22aec.mail.bellsouth.net@ibm67aec.bellsouth.net> for ; Wed, 24 May 2006 16:46:25 -0400 Received: from mail.bellsouth.net ([192.168.16.253]) by ibm67aec.bellsouth.net with SMTP id <20060524204625.WNLR4103.ibm67aec.bellsouth.net@mail.bellsouth.net> for ; Wed, 24 May 2006 16:46:25 -0400 X-Mailer: Openwave WebEngine, version 2.8.16.1 (webedge20-101-1106-101-20040924) X-Originating-IP: [158.158.240.230] From: To: Subject: Re: [gentoo-user] Getting BC not to truncate at the decimal point? Date: Wed, 24 May 2006 16:46:25 -0400 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-Id: <20060524204625.WNLR4103.ibm67aec.bellsouth.net@mail.bellsouth.net> X-Archives-Salt: dcb60fea-9fbb-4927-8ab0-71b78f43aacb X-Archives-Hash: ee4a18fa5e23fc9c2aadfc9ed5818d58 Did you try scale=n Where n is the number of digits after the decimal? More in man bc. > > From: "Mike Huber" > 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