GNU bug report logs - #24561
Unmathematical bc exponentiation behavior

Previous Next

Package: coreutils;

Reported by: "Martens, Tobias" <tobias.martens <at> stud.uni-goettingen.de>

Date: Wed, 28 Sep 2016 17:32:02 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Martens, Tobias" <tobias.martens <at> stud.uni-goettingen.de>
To: 24561 <at> debbugs.gnu.org
Subject: bug#24561: Unmathematical bc exponentiation behavior
Date: Wed, 28 Sep 2016 15:48:27 +0000
[Message part 1 (text/plain, inline)]
Hey,

echo "-(1)^2" | bc
1

I would have expected -1. This behavior is unmathematical and very confusing, because otherwise bc acts quite logic.
Not sure if it is mandated by POSIX, atleast I could not find it to be in the section of exponentiation operator. Was this ever discussed?
Resolving "-(positive float)" to "(-1)*(positive float)" for intern calculation seems more appropriate to me and would give the desired results.

[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 270 days ago.

Previous Next


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