diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-06-16 12:28:20 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-06-16 12:28:20 +0100 |
commit | 3b0dbcfa2e5d12bd80cab1b35f08653d61fe7838 (patch) | |
tree | 924489e978a7841f217615f45982791a28ae2d1c /mpc/src/cmp_si_si.c | |
parent | d9e9919d3be6083548be957c49f8f2b24a6bc18c (diff) | |
download | gcc-tarball-baserock/gcc-7.1.0.tar.gz |
Import ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gzbaserock/gcc-7.1.0
Diffstat (limited to 'mpc/src/cmp_si_si.c')
-rw-r--r-- | mpc/src/cmp_si_si.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mpc/src/cmp_si_si.c b/mpc/src/cmp_si_si.c new file mode 100644 index 0000000000..a50b7585f5 --- /dev/null +++ b/mpc/src/cmp_si_si.c @@ -0,0 +1,34 @@ +/* mpc_cmp_si_si -- Compare a complex number to a number of the form + b+c*i with b and c signed integers. + +Copyright (C) 2005, 2009, 2011 INRIA + +This file is part of GNU MPC. + +GNU MPC 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 3 of the License, or (at your +option) any later version. + +GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ . +*/ + +#include "mpc-impl.h" + +/* return 0 iff a = b */ +int +mpc_cmp_si_si (mpc_srcptr a, long int b, long int c) +{ + int cmp_re, cmp_im; + + cmp_re = mpfr_cmp_si (mpc_realref(a), b); + cmp_im = mpfr_cmp_si (mpc_imagref(a), c); + + return MPC_INEX(cmp_re, cmp_im); +} |