When SameQ is applied to two PrecisionReal numbers that differ in a quantity under the precision, WMA returns True, while Mathics returns False. The issue does not affect Equal. For example, in WMA,
In[1]:= a=N[2/9,3]; b=0.22222`5; {a,b,a==b, a===b}
returns
Out[1]= {0.222,0.22222,True, True}
while in Mathics,
Out[1]:= {0.222,0.22222,True, False}
This issue comes up when we try to implement low-level tests (see for example #145), and seems to be related to how the comparison operator is implemented in mpf.
A similar issue comes up if we evaluate a-b. In WMA,
In[2]:= a=N[2/9,3]; b=0.22222`5; {a-b, Precision[a-b]}
results in
while in Mathics,
A possible fix would be to check the precision in PrecisionReal.sameQ and in the constructors of Real and PrecisionReal..
When
SameQis applied to twoPrecisionRealnumbers that differ in a quantity under the precision, WMA returnsTrue, while Mathics returnsFalse. The issue does not affectEqual. For example, in WMA,returns
while in Mathics,
This issue comes up when we try to implement low-level tests (see for example #145), and seems to be related to how the comparison operator is implemented in mpf.
A similar issue comes up if we evaluate
a-b. In WMA,results in
while in Mathics,
A possible fix would be to check the precision in
PrecisionReal.sameQand in the constructors ofRealandPrecisionReal..