diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-10-02 00:49:40 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-10-02 00:49:40 +0200 |
commit | 718db586a06fe4865c444f1eb27455e601498da7 (patch) | |
tree | 3b4ea90dea35986534e61db279994eedc29482f9 /mpf | |
parent | 75577dba7df9b29d5196f6ccaf3fefc7efd43018 (diff) | |
download | gmp-718db586a06fe4865c444f1eb27455e601498da7.tar.gz |
Use .h instead:
* mpf/fits_s.h: Renamed and adapted from mpf/fits_s.c.
Diffstat (limited to 'mpf')
-rw-r--r-- | mpf/fits_s.i | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/mpf/fits_s.i b/mpf/fits_s.i deleted file mode 100644 index afcdd266c..000000000 --- a/mpf/fits_s.i +++ /dev/null @@ -1,52 +0,0 @@ -/* mpf_fits_s*_p -- test whether an mpf fits a C signed type. - -Copyright 2001 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include "gmp.h" -#include "gmp-impl.h" - - -/* Notice this is equivalent to mpz_set_f + mpz_fits_s*_p. */ - -int -FUNCTION (mpf_srcptr f) -{ - int size, abs_size, i; - mp_exp_t exp; - mp_srcptr ptr; - - size = SIZ(f); - if (size == 0) - return 1; /* zero fits */ - - exp = EXP(f); - if (exp != 1) /* only 1 limb above the radix point */ - return 0; - - /* any fraction limbs must be zero */ - abs_size = ABS(size); - ptr = PTR(f); - for (i = 0; i < abs_size-1; i++) - if (ptr[i] != 0) - return 0; - - return ptr[abs_size-1] - <= (size > 0 ? (mp_limb_t) MAXIMUM : - (mp_limb_t) MINIMUM); -} |