4 * Revision 1.1 2001/04/04 05:43:37 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.3 1999/11/26 09:56:55 bnv
8 * Changed: To use the new macros.
9 * Changed: From char* to byte* comparison, to avoid signed char problems.
10 * Changed: To use the lLastScannedNumber
12 * Revision 1.2 1998/11/10 13:36:14 bnv
13 * Comparison for reals is done with fabs(a-b)<smallnumber
15 * Revision 1.1 1998/07/02 17:18:00 bnv
25 /* -------------------- Lequal ----------------- */
27 Lequal(const PLstr A
, const PLstr B
)
30 byte
*a
, *b
; /* start position in string */
31 byte
*ae
, *be
; /* ending position in string */
34 if (LTYPE(*A
)==LSTRING_TY
) {
37 /* check to see if the first argument is string? */
38 if (ta
== LSTRING_TY
) {
39 L2STR(B
); /* make string and the second */
40 goto eq_str
; /* go and check strings */
43 ra
= lLastScannedNumber
;
49 if (LTYPE(*B
)==LSTRING_TY
) {
51 rb
= lLastScannedNumber
;
57 /* is B also a number */
58 if (tb
!= LSTRING_TY
) {
59 if (fabs(ra
-rb
)<=1E-14)
68 /* nope it was a string */
69 L2STR(A
); /* convert A string */
73 for(; (a
<ae
) && ISSPACE(*a
); a
++) ;
77 for(; (b
<be
) && ISSPACE(*b
); b
++) ;
79 for(;(a
<ae
) && (b
<be
) && (*a
==*b
); a
++,b
++) ;
81 for(; (a
<ae
) && ISSPACE(*a
);a
++) ;
82 for(; (b
<be
) && ISSPACE(*b
);b
++) ;
88 return (*a
<*b
) ? -1 : 1 ;
90 return (a
<ae
) ? 1 : -1 ;