[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ratio implementation
From: |
Kevin Ryde |
Subject: |
Re: ratio implementation |
Date: |
Sat, 18 Oct 2003 10:45:23 +1000 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
Marius Vollmer <address@hidden> writes:
>
> mpq_init (frac);
> mpq_set_d (frac, SCM_REAL_VALUE (z));
> q = scm_make_ratio (scm_i_mpz2num (mpq_numref (frac)),
> scm_i_mpz2num (mpq_denref (frac)));
> mpq_clear (frac);
Yep, that's about it.
I guess the num and den from the mpq_t could be copied directly into
bignums and used as mpz_t's from then on, rather than initializing new
mpz_t's.
Just have to think a bit whether that would be compatible going
forward. We already allow arbitrary mpz calculations on the two
parts, just have to decide if that can include clearing :).
- Re: ratio implementation, (continued)
- Re: ratio implementation, Bill Schottstaedt, 2003/10/13
- Re: ratio implementation, Marius Vollmer, 2003/10/14
- Re: ratio implementation, Kevin Ryde, 2003/10/14
- Re: ratio implementation, Bill Schottstaedt, 2003/10/16
- Re: ratio implementation, Marius Vollmer, 2003/10/17
- Re: ratio implementation, Bill Schottstaedt, 2003/10/17
- Re: ratio implementation, Rob Browning, 2003/10/17
- Re: ratio implementation,
Kevin Ryde <=
- Re: ratio implementation, Bill Schottstaedt, 2003/10/15
- Re: ratio implementation, Marius Vollmer, 2003/10/17
- Re: ratio implementation, Rob Browning, 2003/10/17
- Re: ratio implementation, Marius Vollmer, 2003/10/17
- Re: ratio implementation, Kevin Ryde, 2003/10/14
- ash using shifts (was: ratio implementation), Kevin Ryde, 2003/10/17