# (equal statement1 statement2 \[tolerance\])
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<!-- help-structure:notice -->
> **Source status:** This source topic has 1 recorded inherited issue(s). [Source issue details](../../../Source%20Issues.md).
<!-- /help-structure:notice -->
<a id="166"></a>
## (equal statement1 statement2 \[tolerance\])
---
Determine whether two statements are the same.
---
This function compares *statement1* and *statement2*. If they are equal, LISP returns a T; if not, a nil is returned. Whereas the **equal** function compares lists, the [\= (equal to operator)](%28-%20item1%20item2%20...%29%20%28Equal%20to%20operator%29.md) function compares numbers and strings.
### Examples
| Code | Returns |
| --- | --- |
| (setq x '(1 2 3 4)) | |
| (setq y x) | |
| (**equal** x y) | T |
| (**equal** y '(1 2 3 4)) | T |
The *tolerance* is the amount that the two expressions are allowed to differ, which is very important when comparing [real numbers](../../../Source%20Issues.md#issue-4b6de00b980d24ce) (which tend to suffer from rounding error). In the following example, the two statements can differ by 0.01:
| Code | Returns |
| --- | --- |
| (**equal** 5.6789 5.67 0.01) | T |
**NOTE** The **equal** function is not the same as the [\= (equal to operator)](%28-%20item1%20item2%20...%29%20%28Equal%20to%20operator%29.md) and [eq](%28equal%20statement1%20statement2%20-tolerance-%29.md) functions. The **\=** function returns **T** when two *numbers or strings* are equal. The **equal** function returns **T** when two *expressions* are equal. The **eq** function returns **T** when two expressions are bound to the same *symbol*.
**Tell me about...**
[(setq symbol1 statement1 \[symbol2 statement2\] ...)](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28equal%20statement1%20statement2%20-tolerance-%29.md)