grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
124 stars 24 forks source link

OpenMath: Unary minus instead of binary minus #305

Open grzegorzmazur opened 4 years ago

grzegorzmazur commented 4 years ago

(This issue is split from #294)

In these cases, when converting from Yacas to OpenMath, it should be used the unary minus instead of binary minus.

In> -Pi Out> -Pi In> OMForm(%) <OMOBJ> <OMA> <OMS cd="arith1" name="minus"/> <OMS cd="nums1" name="pi"/> </OMA> </OMOBJ>

In this example, pi is in fact the subtrahend, not the minuend before a binary minus. See also https://www.openmath.org/cd/arith1.html#unary_minus https://www.openmath.org/cd/arith1.html#minus

Another example in which unary_minus would required instead of minus is: In> Solve(x^2-2,x)[2][2] Out> -Sqrt(2) In> OMForm(%) <OMOBJ> <OMA> <OMS cd="arith1" name="minus"/> <OMA> <OMS cd="arith1" name="root"/> <OMI>2</OMI> <OMI>2</OMI> </OMA> </OMA> </OMOBJ> Out> True