#ifndef _MSL_CFLOAT
#define _MSL_CFLOAT

#include <ansi_params.h>

#if !_MSL_USING_MW_C_HEADERS
    #include <float.h>
#else

#include <msl_t.h>

#if _MSL_FLOATING_POINT

#ifndef RC_INVOKED

#define DECIMAL_DIG 17

#ifndef _MSL_FLT_EVAL_METHOD
    #error _MSL_FLT_EVAL_METHOD must be defined in the ansi_prefix.xxx.h
#else
    #define FLT_EVAL_METHOD _MSL_FLT_EVAL_METHOD
#endif

#ifndef _MSL_FLOAT_SIZE
    #define _MSL_FLOAT_SIZE 32
#endif

#ifndef _MSL_DOUBLE_SIZE
    #define _MSL_DOUBLE_SIZE 64
#endif

#ifndef _MSL_LONG_DOUBLE_SIZE
    #define _MSL_LONG_DOUBLE_SIZE 64
#endif

#if !_MSL_FLOAT_HEX

_MSL_BEGIN_EXTERN_C

extern _MSL_IMP_EXP_C _INT32 __float_min[], __float_max[], __float_epsilon[];
extern _MSL_IMP_EXP_C _INT32 __double_min[], __double_max[], __double_epsilon[];
extern _MSL_IMP_EXP_C _INT32 __extended_min[], __extended_max[], __extended_epsilon[];

_MSL_END_EXTERN_C

#endif

#define FLT_ROUNDS 1
#define FLT_RADIX 2

#if _MSL_FLOAT_SIZE == 32

    #define FLT_MANT_DIG 24
    #define FLT_DIG 6
    #define FLT_MIN_EXP (-125)
    #define FLT_MIN_10_EXP (-37)
    #define FLT_MAX_EXP 128
    #define FLT_MAX_10_EXP 38
#if _MSL_FLOAT_HEX
    #define FLT_MAX 0x1.fffffeP127F
    #define FLT_EPSILON 0x1.000000P-23F
    #define FLT_MIN 0x1.000000P-126F
#endif

#else

    #error unsupported size for float in <cfloat>

#endif

#if !_MSL_FLOAT_HEX

    #define FLT_MAX (*(float *)__float_max)
    #define FLT_EPSILON (*(float *)__float_epsilon)
    #define FLT_MIN (*(float *)__float_min)

#endif

#if _MSL_DOUBLE_SIZE == 32

    #define DBL_MANT_DIG 24
    #define DBL_DIG 6
    #define DBL_MIN_EXP (-125)
    #define DBL_MIN_10_EXP (-37)
    #define DBL_MAX_EXP 128
    #define DBL_MAX_10_EXP 38
#if _MSL_FLOAT_HEX
    #define DBL_MAX 0x1.fffffeP127
    #define DBL_EPSILON 0x1.000000P-23
    #define DBL_MIN 0x1.000000P-126
#endif

#elif _MSL_DOUBLE_SIZE == 64

    #define DBL_MANT_DIG 53
    #define DBL_DIG 15
    #define DBL_MIN_EXP (-1021)
    #define DBL_MIN_10_EXP (-308)
    #define DBL_MAX_EXP 1024
    #define DBL_MAX_10_EXP 308
#if _MSL_FLOAT_HEX
    #define DBL_MAX 0x1.fffffffffffffP1023
    #define DBL_EPSILON 0x1.0000000000000P-52
    #define DBL_MIN 0x1.0000000000000P-1022
#endif

#elif _MSL_DOUBLE_SIZE == 80 || _MSL_DOUBLE_SIZE == 96

    #define DBL_MANT_DIG 64
    #define DBL_DIG 18
    #define DBL_MIN_EXP (-16381)
    #define DBL_MIN_10_EXP (-4931)
    #define DBL_MAX_EXP 16384
    #define DBL_MAX_10_EXP 4932
#if _MSL_FLOAT_HEX
    #define DBL_MAX 0x1.fffffffffffffffeP16383
    #define DBL_EPSILON 0x1.0000000000000000P-63
    #define DBL_MIN 0x1.0000000000000000P-16382
#endif

#else

    #error unsupported size for double in <cfloat>

#endif

#if !_MSL_FLOAT_HEX

    #define DBL_MAX (*(double *)__double_max)
    #define DBL_EPSILON (*(double *)__double_epsilon)
    #define DBL_MIN (*(double *)__double_min)

#endif

#if _MSL_LONG_DOUBLE_SIZE == 32

    #define LDBL_MANT_DIG 24
    #define LDBL_DIG 6
    #define LDBL_MIN_EXP (-125)
    #define LDBL_MIN_10_EXP (-37)
    #define LDBL_MAX_EXP 128
    #define LDBL_MAX_10_EXP 38
#if _MSL_FLOAT_HEX
    #define LDBL_MAX 0x1.fffffeP127L
    #define LDBL_EPSILON 0x1.000000P-23L
    #define LDBL_MIN 0x1.000000P-126L
#endif

#elif _MSL_LONG_DOUBLE_SIZE == 64

    #define LDBL_MANT_DIG 53
    #define LDBL_DIG 15
    #define LDBL_MIN_EXP (-1021)
    #define LDBL_MIN_10_EXP (-308)
    #define LDBL_MAX_EXP 1024
    #define LDBL_MAX_10_EXP 308
#if _MSL_FLOAT_HEX
    #define LDBL_MAX 0x1.fffffffffffffP1023L
    #define LDBL_EPSILON 0x1.0000000000000P-52L
    #define LDBL_MIN 0x1.0000000000000P-1022L
#endif

#elif _MSL_LONG_DOUBLE_SIZE == 80 || _MSL_LONG_DOUBLE_SIZE == 96

    #define LDBL_MANT_DIG 64
    #define LDBL_DIG 18
    #define LDBL_MIN_EXP (-16381)
    #define LDBL_MIN_10_EXP (-4931)
    #define LDBL_MAX_EXP 16384
    #define LDBL_MAX_10_EXP 4932
#if _MSL_FLOAT_HEX
    #define LDBL_MAX 0x1.fffffffffffffffeP16383L
    #define LDBL_EPSILON 0x1.0000000000000000P-63L
    #define LDBL_MIN 0x1.0000000000000000P-16382L
#endif

#else

    #error unsupported size for long double in <cfloat>

#endif

#if !_MSL_FLOAT_HEX

    #define LDBL_MAX (*(long double *)__extended_max)
    #define LDBL_EPSILON (*(long double *)__extended_epsilon)
    #define LDBL_MIN (*(long double *)__extended_min)

#endif

#endif

if defined(__arm)
    #include <float.ARM.h>
#endif

#endif

#endif

#endif