blu_os
Loading...
Searching...
No Matches
float.h
Go to the documentation of this file.
1//
2// Created by dylan on 15/07/2026.
3//
4
5#ifndef BLU_OS_MATH_H
6#define BLU_OS_MATH_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
16
17#define FLT_RADIX 2
18#define FLT_MANT_DIG 24
19#define DBL_MANT_DIG 53
20
21//TODO finish float.h
22#if defined(__LDBL_MANT_DIG__)
23 #define LDBL_MANT_DIG __LDBL_MANT_DIG__
24#else
25 #if defined(__aarch64__) || defined(__arm64__)
26 #define LDBL_MANT_DIG 53
27 #elif defined(__x86_64__) || defined(_M_X64)
28 #define LDBL_MANT_DIG 64
29 #else
30 #define LDBL_MANT_DIG 53
31 #endif
32#endif
33
34#if LDBL_MANT_DIG >= 64
35 #define DECIMAL_DIG 21
36#elif LDBL_MANT_DIG >= 53
37 #define DECIMAL_DIG 17
38#elif LDBL_MANT_DIG >= 24
39 #define DECIMAL_DIG 9
40#else
41 #define DECIMAL_DIG 21
42#endif
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif //BLU_OS_MATH_H