Action:
|
Compares two arguments for equality.
|
|
Filename:
|
kern/kern_scm/law_scm.cxx
|
|
Syntax:
|
(test:equal arg1 arg2 [tolerance] [msg])
|
|
Arg Types:
|
arg1
|
boolean | real | position | gvector |
|
|
|
par_pos | number_array | graph |
|
|
|
string
|
|
arg2
|
boolean | real | position | gvector |
|
|
|
par_pos | number_array | graph |
|
|
|
string
|
|
tolerance
|
real
|
|
msg
|
string
|
|
Returns:
|
boolean
|
|
Description:
|
Compares
arg1 and
arg2 and returns true if they are equal. "Equality" for reals, positions, gvectors, and the elements of number arrays, is defined as being within the tolerance value (default
SPAresabs).
|
|
|
arg1 and
arg2 specify the arguments to be tested for equality.
|
|
|
tolerance specifies the tolerance value to be used if the input arguments belong to one of the following types: reals, positions, gvectors, elements of number arrays.
|
|
|
If a
msg string is specified, this string prints out to the debug file if the result is false.
|
|
Example:
|
; test:equal
|
|
(test:equal 2 2)
|
|
;; #t
|
|
(test:equal (position 0 0 0) (position 0 0 1))
|
|
;; #f
|
|
(test:equal 5 5 "different number")
|
|
;; #t
|
|
(test:equal 5 2 "different number")
|
|
;; *** Error test:equal: different number
|
|
;; #f
|