version 1.1.1.2, 2000/09/09 14:12:57 |
version 1.1.1.3, 2003/08/25 16:06:33 |
|
|
/* mpz_set_q (dest_integer, src_rational) -- Assign DEST_INTEGER from |
/* mpz_set_q (dest_integer, src_rational) -- Assign DEST_INTEGER from |
SRC_rational. |
SRC_rational. |
|
|
Copyright (C) 1996 Free Software Foundation, Inc. |
Copyright 1996, 2001 Free Software Foundation, Inc. |
|
|
This file is part of the GNU MP Library. |
This file is part of the GNU MP Library. |
|
|
Line 20 along with the GNU MP Library; see the file COPYING.LI |
|
Line 20 along with the GNU MP Library; see the file COPYING.LI |
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
MA 02111-1307, USA. */ |
MA 02111-1307, USA. */ |
|
|
|
#define __GMP_FORCE_mpz_set_q 1 |
|
|
#include "gmp.h" |
#include "gmp.h" |
#include "gmp-impl.h" |
#include "gmp-impl.h" |
|
|
void |
|
#if __STDC__ |
|
mpz_set_q (mpz_ptr w, mpq_srcptr u) |
|
#else |
|
mpz_set_q (w, u) |
|
mpz_ptr w; |
|
mpq_srcptr u; |
|
#endif |
|
{ |
|
mpz_tdiv_q (w, mpq_numref (u), mpq_denref (u)); |
|
} |
|