Is there a “normal” EqualQ function in Mathematica?

后端 未结 7 654
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 03:49

On the documentation page for Equal we read that

Approximate numbers with machine precision or higher are considered equal if they d

7条回答
  •  情话喂你
    2020-12-24 04:29

    One other way to define such function is by using SetPrecision:

    MyEqual[a_, b_] := SetPrecision[a, Precision[a] + 3] == SetPrecision[b, Precision[b] + 3]
    

    This seems to work in the all cases but I'm still wondering is there a built-in function. It is ugly to use high-level functions for such a primitive task...

提交回复
热议问题