help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calc: Avoid results like TERM1/-TERM2


From: Michael Heerdegen
Subject: Calc: Avoid results like TERM1/-TERM2
Date: Wed, 23 Feb 2022 06:08:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hello,

does anyone from the "Calc people" remember details about the
implementation of `math-neg-fancy'?  I ask because it sometimes puts the
"-" into the denominator and makes the result look ugly, e.g.

M-x calc RET
m s (symbolic mode)
' sqrt(2) / (2 exp(x^2 / 2)) RET
n

gives me in emacs -Q:

sqrt(2) / (-2 exp(x^2 / 2))

with a minus in the denominator - ugh.  Happens not always, but surely
not only in this case.

`math-neg-fancy' is the "culprit" - it tries very hard to hammer the
`neg' somehow into a fraction.  In the above case, the denominator is
chosen.

Does somebody know how to teach Calc to do this only in cases where
it is an actual simplification?  I'm sure the code makes sense in some
usage scenarios - maybe some parts should be conditional?


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]