[BACK]Return to neg.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpfr

Annotation of OpenXM_contrib/gmp/mpfr/neg.c, Revision 1.1.1.2

1.1       maekawa     1: /* mpfr_neg -- change the sign of a floating-point number
                      2:
1.1.1.2 ! ohara       3: Copyright 1999, 2000, 2001 Free Software Foundation.
1.1       maekawa     4:
                      5: This file is part of the MPFR Library.
1.1.1.2 ! ohara       6: Contributed by the Spaces project (LORIA/LIP6).
1.1       maekawa     7:
                      8: The MPFR Library is free software; you can redistribute it and/or modify
1.1.1.2 ! ohara       9: it under the terms of the GNU Lesser General Public License as published by
        !            10: the Free Software Foundation; either version 2.1 of the License, or (at your
1.1       maekawa    11: option) any later version.
                     12:
                     13: The MPFR Library is distributed in the hope that it will be useful, but
                     14: WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1.1.1.2 ! ohara      15: or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
1.1       maekawa    16: License for more details.
                     17:
1.1.1.2 ! ohara      18: You should have received a copy of the GNU Lesser General Public License
1.1       maekawa    19: along with the MPFR Library; see the file COPYING.LIB.  If not, write to
                     20: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
                     21: MA 02111-1307, USA. */
                     22:
                     23: #include "gmp.h"
                     24: #include "mpfr.h"
1.1.1.2 ! ohara      25: #include "mpfr-impl.h"
1.1       maekawa    26:
1.1.1.2 ! ohara      27: int
        !            28: mpfr_neg (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode)
1.1       maekawa    29: {
1.1.1.2 ! ohara      30:   if (a != b)
        !            31:     return mpfr_set4 (a, b, rnd_mode, -MPFR_SIGN(b));
        !            32:   else
        !            33:     {
        !            34:       MPFR_CHANGE_SIGN(a);
        !            35:       MPFR_RET(0);
        !            36:     }
1.1       maekawa    37: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>