Download Target Language Compiler Reference Guide

Transcript
LibIsEqual
Purpose
5LibIsEqual
Compare two expressions (not necessarily of the same type) for equality.
Syntax
%<LibIsEqual(expr1, expr2)>
Arguments
expr1
First expression.
expr2
Second expression.
Returns
1 if expr1 equals expr2; otherwise 0.
Description
LibIsEqual returns 1 if expr1 equals expr2; otherwise, it returns 0.
LibIsEqual is different than the simple equality ”==” because it checks the
types of the expressions. If you compare expressions of different types, this
function will return 0. That is, ”0” does not equal 0. For example, ”0” does not
equal 0. However, expressions of type ”Number” can be compared to those of
type ”Real”, and expressions of type ”String” can be compared to those of type
”Identifier”.
5-68