/[gcl]/gcl/o/num_pred.c
ViewVC logotype

Diff of /gcl/o/num_pred.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by wfs, Sun May 6 15:59:23 2001 UTC revision 1.3 by camm, Sat Jul 20 07:10:55 2002 UTC
# Line 27  Foundation, 675 Mass Ave, Cambridge, MA Line 27  Foundation, 675 Mass Ave, Cambridge, MA
27  #include "num_include.h"  #include "num_include.h"
28    
29    
30  number_zerop(x)  int
31  object  x;  number_zerop(object x)
32  {  {
33          switch (type_of(x)) {          switch (type_of(x)) {
34    
# Line 60  object x; Line 60  object x;
60    
61          default:          default:
62                  FEwrong_type_argument(sLnumber, x);                  FEwrong_type_argument(sLnumber, x);
63                    return(0);
64          }          }
65  }  }
66    
67  number_plusp(x)  int
68  object  x;  number_plusp(object x)
69  {  {
70          switch (type_of(x)) {          switch (type_of(x)) {
71    
# Line 100  object x; Line 101  object x;
101    
102          default:          default:
103                  FEwrong_type_argument(TSor_rational_float,x);                  FEwrong_type_argument(TSor_rational_float,x);
104                    return(0);
105          }          }
106  }  }
107    
108  number_minusp(x)  int
109  object  x;  number_minusp(object x)
110  {  {
111          switch (type_of(x)) {          switch (type_of(x)) {
112    
# Line 140  object x; Line 142  object x;
142    
143          default:          default:
144                  FEwrong_type_argument(TSor_rational_float,x);                  FEwrong_type_argument(TSor_rational_float,x);
145                    return(0);
146          }          }
147  }  }
148    
149  number_oddp(x)  int
150  object x;  number_oddp(object x)
151  {  {
152          int     i;          int i=0;
153    
154          if (type_of(x) == t_fixnum)          if (type_of(x) == t_fixnum)
155                  i = fix(x);                  i = fix(x);
# Line 157  object x; Line 160  object x;
160          return(i & 1);          return(i & 1);
161  }  }
162    
163  number_evenp(x)  int
164  object x;  number_evenp(object x)
165  {  {
166          int     i;          int i=0;
167    
168          if (type_of(x) == t_fixnum)          if (type_of(x) == t_fixnum)
169                  i = fix(x);                  i = fix(x);
# Line 171  object x; Line 174  object x;
174          return(~i & 1);          return(~i & 1);
175  }  }
176    
177  Lzerop()  void
178    Lzerop(void)
179  {  {
180          check_arg(1);          check_arg(1);
181          check_type_number(&vs_base[0]);          check_type_number(&vs_base[0]);
# Line 181  Lzerop() Line 185  Lzerop()
185                  vs_base[0] = Cnil;                  vs_base[0] = Cnil;
186  }  }
187    
188  Lplusp()  void
189    Lplusp(void)
190  {  {
191          check_arg(1);          check_arg(1);
192          check_type_or_rational_float(&vs_base[0]);          check_type_or_rational_float(&vs_base[0]);
# Line 191  Lplusp() Line 196  Lplusp()
196                  vs_base[0] = Cnil;                  vs_base[0] = Cnil;
197  }  }
198    
199  Lminusp()  void
200    Lminusp(void)
201  {  {
202          check_arg(1);          check_arg(1);
203          check_type_or_rational_float(&vs_base[0]);          check_type_or_rational_float(&vs_base[0]);
# Line 201  Lminusp() Line 207  Lminusp()
207                  vs_base[0] = Cnil;                  vs_base[0] = Cnil;
208  }  }
209    
210  Loddp()  void
211    Loddp(void)
212  {  {
213          check_arg(1);          check_arg(1);
214          check_type_integer(&vs_base[0]);          check_type_integer(&vs_base[0]);
# Line 211  Loddp() Line 218  Loddp()
218                  vs_base[0] = Cnil;                  vs_base[0] = Cnil;
219  }  }
220    
221  Levenp()  void
222    Levenp(void)
223  {  {
224          check_arg(1);          check_arg(1);
225          check_type_integer(&vs_base[0]);          check_type_integer(&vs_base[0]);
# Line 222  Levenp() Line 230  Levenp()
230  }  }
231    
232  /* this is just to force things into memory in num_co.c */  /* this is just to force things into memory in num_co.c */
233  void  _assure_in_memory (p)  void  _assure_in_memory (void *p)
      void *p;  
234  {  {
235  ;  ;
236  }  }
237    
238  int  int
239  lf_eqlp(p,q)  lf_eqlp(double *p, double *q)
      double *p,*q;  
240  {  {
241    return *p == *q;    return *p == *q;
242  }  }
243    
244    
245  init_num_pred()  void
246    init_num_pred(void)
247  {  {
248  #ifndef GMP  #ifndef GMP
249          big_register_1 = new_bignum();          big_register_1 = new_bignum();

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26