File Index
Files and directories
Sign in
FILE

math.h

File preview with syntax highlighting.

linux-6.19.14/tools/include/nolibc/math.h C
 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 */
~/ Read-only file preview.