Home | History | Annotate | Line # | Download | only in math
      1  1.1  mrg /* Return minimum numeric value of X and Y.
      2  1.1  mrg    Copyright (C) 1997-2018 Free Software Foundation, Inc.
      3  1.1  mrg    This file is part of the GNU C Library.
      4  1.1  mrg    Contributed by Ulrich Drepper <drepper (at) cygnus.com>, 1997.
      5  1.1  mrg 
      6  1.1  mrg    The GNU C Library is free software; you can redistribute it and/or
      7  1.1  mrg    modify it under the terms of the GNU Lesser General Public
      8  1.1  mrg    License as published by the Free Software Foundation; either
      9  1.1  mrg    version 2.1 of the License, or (at your option) any later version.
     10  1.1  mrg 
     11  1.1  mrg    The GNU C Library is distributed in the hope that it will be useful,
     12  1.1  mrg    but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  1.1  mrg    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14  1.1  mrg    Lesser General Public License for more details.
     15  1.1  mrg 
     16  1.1  mrg    You should have received a copy of the GNU Lesser General Public
     17  1.1  mrg    License along with the GNU C Library; if not, see
     18  1.1  mrg    <http://www.gnu.org/licenses/>.  */
     19  1.1  mrg 
     20  1.1  mrg #include "quadmath-imp.h"
     21  1.1  mrg 
     22  1.1  mrg __float128
     23  1.1  mrg fminq (__float128 x, __float128 y)
     24  1.1  mrg {
     25  1.1  mrg   if (__builtin_islessequal (x, y))
     26  1.1  mrg     return x;
     27  1.1  mrg   else if (__builtin_isgreater (x, y))
     28  1.1  mrg     return y;
     29  1.1  mrg   else if (issignalingq (x) || issignalingq (y))
     30  1.1  mrg     return x + y;
     31  1.1  mrg   else
     32  1.1  mrg     return isnanq (y) ? x : y;
     33  1.1  mrg }
     34