GNU bug report logs - #30453
Bug in BC calculator version 1.07.1

Previous Next

Package: coreutils;

Reported by: Thomas Bracken <t.bracken <at> shaw.ca>

Date: Wed, 14 Feb 2018 07:27:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30453 in the body.
You can then email your comments to 30453 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#30453; Package coreutils. (Wed, 14 Feb 2018 07:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Bracken <t.bracken <at> shaw.ca>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 14 Feb 2018 07:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thomas Bracken <t.bracken <at> shaw.ca>
To: bug-coreutils <at> gnu.org
Subject: Re: Bug in BC calculator version 1.07.1
Date: Tue, 13 Feb 2018 22:52:22 -0800
[Message part 1 (text/plain, inline)]
Hello,

Your BC calculator does not do any truncation for the scale value

when it does a multiplication.  See example below.

It works fine on division, but not on multiplication.

Cheers!

Tom Bracken

[thomas <at> HP6005computer1 ~]$ bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free 
Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
scale = 5
56.4325435 / 6.3408340583467346436
8.89986
56.4325435 * 6.3408340583467346436
357.82939_38239336408579_
56.4325435 * 6.3408340583467346436 / 1
357.82939
quit
[thomas <at> HP6005computer1 ~]$




-- 
[Message part 2 (text/html, inline)]
[Thomas.jpg (image/jpeg, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#30453; Package coreutils. (Wed, 14 Feb 2018 22:51:01 GMT) Full text and rfc822 format available.

Message #8 received at 30453 <at> debbugs.gnu.org (full text, mbox):

From: Martin Møller Skarbiniks Pedersen <traxplayer <at> gmail.com>
To: Martin Møller Skarbiniks Pedersen <traxplayer <at> gmail.com>
Cc: 30453 <at> debbugs.gnu.org
Subject: Re: bug#30453: Bug in BC calculator version 1.07.1
Date: Wed, 14 Feb 2018 23:33:29 +0100
This is not a bug.
From the man-page:

$ man bc | fgrep -A5 "expr * expr"
       expr * expr
              The result of the expression is the product of the two
expressions.

       expr / expr
              The  result  of  the  expression  is  the quotient of
the two expressions.  The scale of the result is the value of the
variable
              scale.


So expr * expr is not scaled but expr / expr is scaled.

Regards
Martin



On 14 February 2018 at 07:52, Thomas Bracken <t.bracken <at> shaw.ca> wrote:
> Hello,
>
> Your BC calculator does not do any truncation for the scale value
>
> when it does a multiplication.  See example below.
>
> It works fine on division, but not on multiplication.
>

This is not a bug.
From the man-page:

$ man bc | fgrep -A5 "expr * expr"
       expr * expr
              The result of the expression is the product of the two
expressions.

       expr / expr
              The  result  of  the  expression  is  the quotient of
the two expressions.  The scale of the result is the value of the
variable
              scale.


Regards
Martin




Information forwarded to bug-coreutils <at> gnu.org:
bug#30453; Package coreutils. (Tue, 30 Oct 2018 02:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 30453 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 30453 <at> debbugs.gnu.org
Subject: Re: bug#30453: Bug in BC calculator version 1.07.1
Date: Mon, 29 Oct 2018 20:46:34 -0600
tags 30453 notabug
close 30453
stop

(triaging old bugs)

On 2018-02-14 3:33 p.m., Martin Møller Skarbiniks Pedersen wrote:
> This is not a bug.
>  From the man-page:
> 
> $ man bc | fgrep -A5 "expr * expr"
>         expr * expr
>                The result of the expression is the product of the two
> expressions.
> 
>         expr / expr
>                The  result  of  the  expression  is  the quotient of
> the two expressions.  The scale of the result is the value of the
> variable
>                scale.

as bc(1) is not part of GNU coreutils,
I'm closing this bug.

-assaf





Added tag(s) notabug. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 30 Oct 2018 02:47:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 30453 <at> debbugs.gnu.org and Thomas Bracken <t.bracken <at> shaw.ca> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 30 Oct 2018 02:47:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Nov 2018 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.