s_fmaxf.c (f73fafd8) s_fmaxf.c (96943daa)
1/* $OpenBSD: s_fmaxf.c,v 1.2 2008/09/11 19:18:12 martynas Exp $ */
1/* $OpenBSD: s_fmaxf.c,v 1.3 2013/11/12 18:28:02 martynas Exp $ */
2/*-
3 * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

32{
33 /* Check for NaNs to avoid raising spurious exceptions. */
34 if (isnan(x))
35 return (y);
36 if (isnan(y))
37 return (x);
38
39 /* Handle comparisons of signed zeroes. */
2/*-
3 * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

32{
33 /* Check for NaNs to avoid raising spurious exceptions. */
34 if (isnan(x))
35 return (y);
36 if (isnan(y))
37 return (x);
38
39 /* Handle comparisons of signed zeroes. */
40 if (signbit(x) != signbit(y))
40 if (signbit(x) != signbit(y)) {
41 if (signbit(x))
42 return (y);
43 else
44 return (x);
41 if (signbit(x))
42 return (y);
43 else
44 return (x);
45 }
45
46 return (x > y ? x : y);
47}
46
47 return (x > y ? x : y);
48}