1 //===-- Definition of macros from math.h ----------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef __LLVM_LIBC_MACROS_MATH_MACROS_H
10 #define __LLVM_LIBC_MACROS_MATH_MACROS_H
13 #define MATH_ERREXCEPT 2
15 #define HUGE_VAL __builtin_huge_val()
16 #define INFINITY __builtin_inf()
17 #define NAN __builtin_nanf("")
19 #define FP_ILOGB0 (-__INT_MAX__ - 1)
20 #define FP_ILOGBNAN __INT_MAX__
22 #define isfinite(x) __builtin_isfinite(x)
23 #define isinf(x) __builtin_isinf(x)
24 #define isnan(x) __builtin_isnan(x)
27 #define math_errhandling 0
28 #elif defined __NO_MATH_ERRNO__
29 #define math_errhandling (MATH_ERREXCEPT)
31 #define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
34 #endif // __LLVM_LIBC_MACROS_MATH_MACROS_H