bug#24561: Unmathematical bc exponentiation behavior
From:
Martens, Tobias
Subject:
bug#24561: Unmathematical bc exponentiation behavior
Date:
Wed, 28 Sep 2016 15:48:27 +0000
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.