lib/libc/min: Introduce simple math.h
Introduce math.h to get definitions of float_t and double_t. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
fa9d8e09a0
commit
4cbe5c0961
1 changed files with 41 additions and 0 deletions
41
lib/libc/minimal/include/math.h
Normal file
41
lib/libc/minimal/include/math.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Linaro Limited.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_MATH_H_
|
||||
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_MATH_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(FLT_EVAL_METHOD) && defined(__FLT_EVAL_METHOD__)
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
#endif
|
||||
|
||||
#if defined FLT_EVAL_METHOD
|
||||
#if FLT_EVAL_METHOD == 0
|
||||
typedef float float_t;
|
||||
typedef double double_t;
|
||||
#elif FLT_EVAL_METHOD == 1
|
||||
typedef double float_t;
|
||||
typedef double double_t;
|
||||
#elif FLT_EVAL_METHOD == 2
|
||||
typedef long double float_t;
|
||||
typedef long double double_t;
|
||||
#else
|
||||
/* Implementation-defined. Assume float_t and double_t have
|
||||
* already been defined */
|
||||
#endif
|
||||
#else
|
||||
typedef float float_t;
|
||||
typedef double double_t;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_MATH_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue