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

Diff of /gcl/o/gmp_big.c

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

revision 1.1 by wfs, Fri May 18 09:21:26 2001 UTC revision 1.1.4.1 by camm, Fri Jun 7 22:14:45 2002 UTC
# Line 354  copy_to_big(x) Line 354  copy_to_big(x)
354  }  }
355    
356    
357    /* put in to get (declare integer working with existing setup.
358       should be optimized at some point, as we're just converting
359       and reconverting integer data, it appears -- CM */
360    
361    int
362    obj_to_mpz(object x,MP_INT * y) {
363    
364      int ret=0;
365    
366      switch(type_of(x)) {
367      case t_fixnum:
368        mpz_set_si(y,fix(x));
369        break;
370      case t_bignum:
371        mpz_set(y,MP(x));
372        break;
373      default:
374        FEerror("fixnum or bignum expected",0);
375        ret=1;
376        break;
377      }
378    
379      return ret;
380    
381    }
382    
383    int
384    mpz_to_mpz(MP_INT * x,MP_INT * y) {
385    
386      int ret=0;
387    
388      mpz_set(y,x);
389      return ret;
390    
391    }
392    
393    void
394    isetq_fix(MP_INT * var,int s)
395    {
396      mpz_set_si(var,s);
397    }
398    
399    MP_INT *
400    otoi(object x) {
401      if (type_of(x)==t_fixnum) {
402        object y = new_bignum();
403        mpz_set_si(MP(y),fix(x));
404        return MP(y);
405      }
406      if (type_of(x)==t_bignum)
407        return (MP(x));
408      FEwrong_type_argument(sLinteger,x);
409      return NULL;
410    }
411    /* end added section for declare integer -- CM */
412    
413    
414    
415    
416  /* return object like *xpt coercing to a fixnum if necessary,  /* return object like *xpt coercing to a fixnum if necessary,

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

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