1 /* 2 Copyright (C) 2011 Fredrik Johansson 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 <stdio.h> 13 #include <stdlib.h> 14 #include <gmp.h> 15 #include "flint.h" 16 #include "ulong_extras.h" 17 #include "fmpz.h" 18 19 /* TODO: speedup for small n,k */ fmpz_bin_uiui(fmpz_t res,ulong n,ulong k)20void fmpz_bin_uiui(fmpz_t res, ulong n, ulong k) 21 { 22 __mpz_struct * t = _fmpz_promote(res); 23 flint_mpz_bin_uiui(t, n, k); 24 _fmpz_demote_val(res); 25 } 26