Equal
Usage
• 如果 lhs和 rhs相同, lhs rhs返回 True.
Notes
• lhs rhs用来表示一个即将使用函数如 Solve等处理的符号等式. • 如果 lhs和 rhs是同一表达式, lhs rhs返回 True . • 如果通过比较数字或其它元数据,比如字符串, lhs和 rhs确实不相等, lhs rhs返回 False. • 对于近似数,如果它们至多在最后八个二进制位不同(粗略地计算,等价于至多在最后两个十进制位不同),则它们被认为是相等的.
• 2 2.的结果为 True. • Equal[e] 的结果为True. •对于精确数值, Equal在内部通过数值近似建立不等式.这个过程可能受到全局变量$MaxExtraPrecision设置的影响. • 在 StandardForm和 InputForm中, lhs rhs可以输入为 lhs \ [Equal] rhs 或 lhs rhs.
Further Examples
For comparison, SameQ ( =) checks whether the expressions are identical in form.
In[1]:=
|
Out[1]=
|
Equal will return unevaluated if it cannot determine that the right-hand side and left-hand side are identical. SameQ is more assertive; use it if you need a function that will return False.
In[2]:=
|
Out[2]=
|
|