Gentoo Archives: gentoo-user

From: Mike Huber <michael.huber@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Getting BC not to truncate at the decimal point?
Date: Wed, 24 May 2006 20:30:46
Message-Id: e1a7ee0c0605240948v690c5605x1cc39b6fcc8921e7@mail.gmail.com
1 Hi,
2 I'm just trying to do some quick calculations using bc, but the version
3 installed through portage truncates on multiplication/division. It didn't
4 used to do this 2 years ago when I was taking number theory, and there are
5 no USE flags available for sys-devel/bc to change this. From the manpage:
6
7 ---------------------------------------------------------------------
8
9 The most basic element in bc is the number. Numbers are arbitrary precision
10 numbers. This precision is both in the integer part and the fractional
11 part. All numbers are represented internally in decimal and all computation
12 is done in decimal. (This version truncates results from divide and
13 multiply operations.) There are two attributes of numbers, the length and
14 the scale. The length is the total number of significant decimal digits
15 in a number and the scale is the total number of decimal digits after the
16 decimal point. For example:
17 .000001 has a length of 6 and scale of 6.
18 1935.000 has a length of 7 and a scale of 3.
19
20
21 ------------------------------------------------------------------------
22
23
24 Anyone have any ideas?
25
26 --Mike

Replies

Subject Author
Re: [SPAM] - [gentoo-user] Getting BC not to truncate at the decimal point? - Bayesian Filter detected spam Harald Arnesen <harald@×××××××.org>
Re: [gentoo-user] Getting BC not to truncate at the decimal point? John Green <jg012b8403_2@×××××××××××××.uk>