Fix signed integer overflow in random_r (bug 17343).
[glibc.git] / sysdeps / sparc / fpu / bits / mathinline.h
blobf6118c7ca50bb3630a81e6b415dea77aad8f5c68
1 /* Inline math functions for SPARC.
2 Copyright (C) 1999-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Jakub Jelinek <jakub@redhat.com>.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef _MATH_H
21 # error "Never use <bits/mathinline.h> directly; include <math.h> instead."
22 #endif
24 #include <bits/wordsize.h>
26 #ifdef __GNUC__
28 #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) && defined __OPTIMIZE__
30 # ifndef __extern_inline
31 # define __MATH_INLINE __inline
32 # else
33 # define __MATH_INLINE __extern_inline
34 # endif /* __cplusplus */
36 # ifdef __USE_ISOC99
38 # ifndef __NO_MATH_INLINES
40 __MATH_INLINE double __NTH (fdim (double __x, double __y));
41 __MATH_INLINE double
42 __NTH (fdim (double __x, double __y))
44 return __x <= __y ? 0 : __x - __y;
47 __MATH_INLINE float __NTH (fdimf (float __x, float __y));
48 __MATH_INLINE float
49 __NTH (fdimf (float __x, float __y))
51 return __x <= __y ? 0 : __x - __y;
54 # endif /* !__NO_MATH_INLINES */
55 # endif /* __USE_ISOC99 */
56 #endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
57 #endif /* __GNUC__ */