Home | History | Annotate | Line # | Download | only in noieee_src
n_fmax.c revision 1.1.6.1
      1      1.1  jakllsch /*
      2      1.1  jakllsch  * Copyright (c) 2011 Jonathan A. Kollasch
      3      1.1  jakllsch  * All rights reserved.
      4      1.1  jakllsch  *
      5      1.1  jakllsch  * Redistribution and use in source and binary forms, with or without
      6      1.1  jakllsch  * modification, are permitted provided that the following conditions
      7      1.1  jakllsch  * are met:
      8      1.1  jakllsch  * 1. Redistributions of source code must retain the above copyright
      9      1.1  jakllsch  *    notice, this list of conditions and the following disclaimer.
     10      1.1  jakllsch  * 2. Redistributions in binary form must reproduce the above copyright
     11      1.1  jakllsch  *    notice, this list of conditions and the following disclaimer in the
     12      1.1  jakllsch  *    documentation and/or other materials provided with the distribution.
     13      1.1  jakllsch  *
     14      1.1  jakllsch  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     15      1.1  jakllsch  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     16      1.1  jakllsch  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     17      1.1  jakllsch  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
     18      1.1  jakllsch  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     19      1.1  jakllsch  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     20      1.1  jakllsch  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     21      1.1  jakllsch  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     22      1.1  jakllsch  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     23      1.1  jakllsch  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     24      1.1  jakllsch  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25      1.1  jakllsch  */
     26      1.1  jakllsch 
     27      1.1  jakllsch #include <sys/cdefs.h>
     28      1.1  jakllsch #if defined(LIBM_SCCS) && !defined(lint)
     29  1.1.6.1      yamt __RCSID("$NetBSD: n_fmax.c,v 1.1.6.1 2014/05/22 11:36:57 yamt Exp $");
     30      1.1  jakllsch #endif
     31      1.1  jakllsch 
     32      1.1  jakllsch #include <math.h>
     33      1.1  jakllsch 
     34  1.1.6.1      yamt #ifdef __weak_alias
     35  1.1.6.1      yamt __weak_alias(fmaxl, fmax);
     36  1.1.6.1      yamt #endif
     37  1.1.6.1      yamt 
     38      1.1  jakllsch double
     39      1.1  jakllsch fmax(double x, double y)
     40      1.1  jakllsch {
     41      1.1  jakllsch 	return x > y ? x : y;
     42      1.1  jakllsch }
     43