1 |
/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003 Free Software Foundation, Inc. |
/* Copyright (C) 1995,1996,1997,1998,2000,2001,2003 Free Software Foundation, Inc. |
2 |
* |
* |
3 |
* This library is free software; you can redistribute it and/or |
* This library is free software; you can redistribute it and/or |
4 |
* modify it under the terms of the GNU Lesser General Public |
* modify it under the terms of the GNU Lesser General Public |
80 |
if (SCM_CELL_TYPE (x) != SCM_CELL_TYPE (y)) |
if (SCM_CELL_TYPE (x) != SCM_CELL_TYPE (y)) |
81 |
{ |
{ |
82 |
/* treat mixes of real and complex types specially */ |
/* treat mixes of real and complex types specially */ |
83 |
if (SCM_SLOPPY_INEXACTP (x)) |
if (SCM_INEXACTP (x)) |
84 |
{ |
{ |
85 |
if (SCM_SLOPPY_REALP (x)) |
if (SCM_REALP (x)) |
86 |
return SCM_BOOL (SCM_SLOPPY_COMPLEXP (y) |
return SCM_BOOL (SCM_COMPLEXP (y) |
87 |
&& real_eqv (SCM_REAL_VALUE (x), |
&& real_eqv (SCM_REAL_VALUE (x), |
88 |
SCM_COMPLEX_REAL (y)) |
SCM_COMPLEX_REAL (y)) |
89 |
&& 0.0 == SCM_COMPLEX_IMAG (y)); |
&& SCM_COMPLEX_IMAG (y) == 0.0); |
90 |
else |
else |
91 |
return SCM_BOOL (SCM_SLOPPY_REALP (y) |
return SCM_BOOL (SCM_REALP (y) |
92 |
&& real_eqv (SCM_COMPLEX_REAL (x), |
&& real_eqv (SCM_COMPLEX_REAL (x), |
93 |
SCM_REAL_VALUE (y)) |
SCM_REAL_VALUE (y)) |
94 |
&& SCM_COMPLEX_IMAG (x) == 0.0); |
&& SCM_COMPLEX_IMAG (x) == 0.0); |
98 |
if (SCM_NUMP (x)) |
if (SCM_NUMP (x)) |
99 |
{ |
{ |
100 |
if (SCM_BIGP (x)) { |
if (SCM_BIGP (x)) { |
101 |
return SCM_BOOL (0 == scm_i_bigcmp (x, y)); |
return SCM_BOOL (scm_i_bigcmp (x, y) == 0); |
102 |
} else if (SCM_SLOPPY_REALP (x)) { |
} else if (SCM_REALP (x)) { |
103 |
return SCM_BOOL (real_eqv (SCM_REAL_VALUE (x), SCM_REAL_VALUE (y))); |
return SCM_BOOL (real_eqv (SCM_REAL_VALUE (x), SCM_REAL_VALUE (y))); |
104 |
} else { /* complex */ |
} else { /* complex */ |
105 |
return SCM_BOOL (real_eqv (SCM_COMPLEX_REAL (x), |
return SCM_BOOL (real_eqv (SCM_COMPLEX_REAL (x), |
149 |
if (SCM_CELL_TYPE (x) != SCM_CELL_TYPE (y)) |
if (SCM_CELL_TYPE (x) != SCM_CELL_TYPE (y)) |
150 |
{ |
{ |
151 |
/* treat mixes of real and complex types specially */ |
/* treat mixes of real and complex types specially */ |
152 |
if (SCM_SLOPPY_INEXACTP (x)) |
if (SCM_INEXACTP (x)) |
153 |
{ |
{ |
154 |
if (SCM_SLOPPY_REALP (x)) |
if (SCM_REALP (x)) |
155 |
return SCM_BOOL (SCM_SLOPPY_COMPLEXP (y) |
return SCM_BOOL (SCM_COMPLEXP (y) |
156 |
&& SCM_REAL_VALUE (x) == SCM_COMPLEX_REAL (y) |
&& SCM_REAL_VALUE (x) == SCM_COMPLEX_REAL (y) |
157 |
&& 0.0 == SCM_COMPLEX_IMAG (y)); |
&& SCM_COMPLEX_IMAG (y) == 0.0); |
158 |
else |
else |
159 |
return SCM_BOOL (SCM_SLOPPY_REALP (y) |
return SCM_BOOL (SCM_REALP (y) |
160 |
&& SCM_COMPLEX_REAL (x) == SCM_REAL_VALUE (y) |
&& SCM_COMPLEX_REAL (x) == SCM_REAL_VALUE (y) |
161 |
&& SCM_COMPLEX_IMAG (x) == 0.0); |
&& SCM_COMPLEX_IMAG (x) == 0.0); |
162 |
} |
} |