HPM SDK
HPMicro Software Development Kit
hpm_mcl_math.h File Reference
#include "hpm_mcl_cfg.h"
#include <math.h>

Go to the source code of this file.

Macros

#define MCL_FLOAT_IS_ZERO(val)   ((val < 0.000001f) && (val > -0.000001f))
 Determine if a floating point number is 0. More...
 
#define MCL_FLOAT_IS_INFINITY(val)   ((val == INFINITY) || (val == -INFINITY))
 
#define SQRT3   (1.7320508075688773f)
 
#define SQRT3_DIV3   (0.5773502691896258f)
 
#define MCL_SUM_OF_SQUARE_MODE(a, b)   sqrtf((float)((a * a) + (b * b)))
 
#define MCL_MATH_IS_ZERO(x)   MCL_FLOAT_IS_ZERO((x))
 
#define MCL_MATH_CONVERT_FLOAT(x)   (x)
 

Typedefs

typedef float hpm_mcl_type_t
 Enable Q format. More...
 

Macro Definition Documentation

◆ MCL_FLOAT_IS_INFINITY

#define MCL_FLOAT_IS_INFINITY (   val)    ((val == INFINITY) || (val == -INFINITY))

◆ MCL_FLOAT_IS_ZERO

#define MCL_FLOAT_IS_ZERO (   val)    ((val < 0.000001f) && (val > -0.000001f))

Determine if a floating point number is 0.

◆ MCL_MATH_CONVERT_FLOAT

#define MCL_MATH_CONVERT_FLOAT (   x)    (x)

◆ MCL_MATH_IS_ZERO

#define MCL_MATH_IS_ZERO (   x)    MCL_FLOAT_IS_ZERO((x))

◆ MCL_SUM_OF_SQUARE_MODE

#define MCL_SUM_OF_SQUARE_MODE (   a,
 
)    sqrtf((float)((a * a) + (b * b)))

◆ SQRT3

#define SQRT3   (1.7320508075688773f)

sqrt(3)

◆ SQRT3_DIV3

#define SQRT3_DIV3   (0.5773502691896258f)

sqrt(3)/3

Typedef Documentation

◆ hpm_mcl_type_t

typedef float hpm_mcl_type_t

Enable Q format.