1 /* 2 Copyright (C) 2009 William Hart 3 4 This file is part of FLINT. 5 6 FLINT is free software: you can redistribute it and/or modify it under 7 the terms of the GNU Lesser General Public License (LGPL) as published 8 by the Free Software Foundation; either version 2.1 of the License, or 9 (at your option) any later version. See <http://www.gnu.org/licenses/>. 10 */ 11 12 #include <gmp.h> 13 #include "flint.h" 14 #include "ulong_extras.h" 15 #include "fmpz.h" 16 17 void fmpz_init2(fmpz_t f,ulong limbs)18fmpz_init2(fmpz_t f, ulong limbs) 19 { 20 if (limbs) 21 { 22 __mpz_struct *mpz_ptr = _fmpz_new_mpz(); 23 *f = PTR_TO_COEFF(mpz_ptr); 24 _mpz_realloc(mpz_ptr, limbs); 25 } 26 else 27 { 28 (*f) = WORD(0); 29 } 30 } 31