PER Firmware
Loading...
Searching...
No Matches
min.h File Reference

Minimum value functions utility header. More...

Go to the source code of this file.

Macros

#define MINOF2(a, b)
 
#define MINOF3(a, b, c)
 
#define MINOF4(a, b, c, d)
 
#define DISPATCH_MINOF(_1, _2, _3, _4, NAME, ...)
 
#define MINOF(...)
 

Detailed Description

Minimum value functions utility header.

Typesafe, supporting ints and floats. Generic MINOF interface for 2, 3, or 4 arguments. Integer promotions also cover int8_t, uint8_t, int16_t, uint16_t

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Macro Definition Documentation

◆ DISPATCH_MINOF

#define DISPATCH_MINOF ( _1,
_2,
_3,
_4,
NAME,
... )
Value:
NAME

◆ MINOF

#define MINOF ( ...)
Value:
DISPATCH_MINOF(__VA_ARGS__, MINOF4, MINOF3, MINOF2)(__VA_ARGS__)

◆ MINOF2

#define MINOF2 ( a,
b )
Value:
_Generic((a) + (b), \
signed int: min2_signed, \
unsigned int: min2_unsigned, \
float: min2_float \
)(a, b)

◆ MINOF3

#define MINOF3 ( a,
b,
c )
Value:
MINOF2(MINOF2(a, b), c)

◆ MINOF4

#define MINOF4 ( a,
b,
c,
d )
Value:
MINOF2(MINOF2(a, b), MINOF2(c, d))