Warning: This file is not a C or C++ file. It does not have highlighting.

1/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2/*
3 * math definitions for NOLIBC
4 * Copyright (C) 2025 Thomas Weißschuh <thomas.weissschuh@linutronix.de>
5 */
6
7/* make sure to include all global symbols */
8#include "nolibc.h"
9
10#ifndef _NOLIBC_SYS_MATH_H
11#define _NOLIBC_SYS_MATH_H
12
13static __inline__
14double fabs(double x)
15{
16 return x >= 0 ? x : -x;
17}
18
19static __inline__
20float fabsf(float x)
21{
22 return x >= 0 ? x : -x;
23}
24
25static __inline__
26long double fabsl(long double x)
27{
28 return x >= 0 ? x : -x;
29}
30
31#endif /* _NOLIBC_SYS_MATH_H */
32

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of linux/tools/include/nolibc/math.h