xref: /minix3/lib/libm/noieee_src/n_fmax.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
12fe8fb19SBen Gras /*
22fe8fb19SBen Gras  * Copyright (c) 2011 Jonathan A. Kollasch
32fe8fb19SBen Gras  * All rights reserved.
42fe8fb19SBen Gras  *
52fe8fb19SBen Gras  * Redistribution and use in source and binary forms, with or without
62fe8fb19SBen Gras  * modification, are permitted provided that the following conditions
72fe8fb19SBen Gras  * are met:
82fe8fb19SBen Gras  * 1. Redistributions of source code must retain the above copyright
92fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer.
102fe8fb19SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
112fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer in the
122fe8fb19SBen Gras  *    documentation and/or other materials provided with the distribution.
132fe8fb19SBen Gras  *
142fe8fb19SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
152fe8fb19SBen Gras  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
162fe8fb19SBen Gras  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
172fe8fb19SBen Gras  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
182fe8fb19SBen Gras  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
192fe8fb19SBen Gras  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
202fe8fb19SBen Gras  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
212fe8fb19SBen Gras  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
222fe8fb19SBen Gras  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
232fe8fb19SBen Gras  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
242fe8fb19SBen Gras  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
252fe8fb19SBen Gras  */
262fe8fb19SBen Gras 
272fe8fb19SBen Gras #include <sys/cdefs.h>
282fe8fb19SBen Gras #if defined(LIBM_SCCS) && !defined(lint)
29*0a6a1f1dSLionel Sambuc __RCSID("$NetBSD: n_fmax.c,v 1.2 2014/02/03 21:22:21 martin Exp $");
302fe8fb19SBen Gras #endif
312fe8fb19SBen Gras 
322fe8fb19SBen Gras #include <math.h>
332fe8fb19SBen Gras 
34*0a6a1f1dSLionel Sambuc #ifdef __weak_alias
35*0a6a1f1dSLionel Sambuc __weak_alias(fmaxl, fmax);
36*0a6a1f1dSLionel Sambuc #endif
37*0a6a1f1dSLionel Sambuc 
382fe8fb19SBen Gras double
fmax(double x,double y)392fe8fb19SBen Gras fmax(double x, double y)
402fe8fb19SBen Gras {
412fe8fb19SBen Gras 	return x > y ? x : y;
422fe8fb19SBen Gras }
43