Added floating-point types and limits
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
19
ev_limits.h
19
ev_limits.h
@@ -13,6 +13,9 @@ struct UInt16Data { u16 MIN; u16 MAX; };
|
||||
struct UInt32Data { u32 MIN; u32 MAX; };
|
||||
struct UInt64Data { u64 MIN; u64 MAX; };
|
||||
|
||||
struct Float32Data { f32 MIN; f32 MAX; f32 MIN_POS; f32 EPS; };
|
||||
struct Float64Data { f64 MIN; f64 MAX; f64 MIN_POS; f64 EPS; };
|
||||
|
||||
static const struct Int8Data Int8 =
|
||||
{
|
||||
.MIN = -128,
|
||||
@@ -61,4 +64,20 @@ static const struct UInt64Data UInt64 =
|
||||
.MAX = 18446744073709551615ULL
|
||||
};
|
||||
|
||||
static const struct Float32Data Float32 =
|
||||
{
|
||||
.MIN_POS = 1.175494351e-38,
|
||||
.MIN = -3.402823466e+38,
|
||||
.MAX = 3.402823466e+38,
|
||||
.EPS = 1.192093e-07
|
||||
};
|
||||
|
||||
static const struct Float64Data Float64 =
|
||||
{
|
||||
.MIN_POS = 2.2250738585072014e-308,
|
||||
.MIN = -1.7976931348623158e+308,
|
||||
.MAX = 1.7976931348623158e+308,
|
||||
.EPS = 2.2204460492503131e-016
|
||||
};
|
||||
|
||||
#endif // EV_HEADERS_LIMITS_H
|
||||
|
||||
@@ -13,4 +13,8 @@ typedef unsigned short int u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned long long int u64;
|
||||
|
||||
// Floating-Point Numbers
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
|
||||
#endif // EV_HEADERS_TYPES_H
|
||||
|
||||
Reference in New Issue
Block a user