I reported this upstream and received this reply:

    From: Phil Nelson <[EMAIL PROTECTED]>
    Subject: Re: Bc Scale Bug
    To: [EMAIL PROTECTED]
    Date: Sun, 28 Jan 2007 17:04:18 -0800
    Resent-From: [EMAIL PROTECTED]

    On Sunday 28 January 2007 16:57, you wrote:
    >   $ echo "scale=0; 10 * 2.1" | bc
    >   21.0
    >   $ echo "scale=0; ( 10 * 2.1 ) / 1" | bc
    >   21

    This is not a scale bug.  This is how the POSIX spec specifies
    the computation.  The "10 * 2.1" ends up doing the computation
    with an effective scale of 1 ignoring the scale variable.
    In the division, that one uses the scale variable.

    This is not documented as well as possible in the manual page.
    I'll try to fix it. (doc bug)

    --Phil


-- 
John Hasler


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to