Add min/max/clamp methods for doubles
This commit is contained in:
parent
d339120145
commit
08dfbcfd5c
@ -52,6 +52,10 @@ extern inline ALfloat minf(ALfloat a, ALfloat b);
|
||||
extern inline ALfloat maxf(ALfloat a, ALfloat b);
|
||||
extern inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max);
|
||||
|
||||
extern inline ALdouble mind(ALdouble a, ALdouble b);
|
||||
extern inline ALdouble maxd(ALdouble a, ALdouble b);
|
||||
extern inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max);
|
||||
|
||||
extern inline ALuint minu(ALuint a, ALuint b);
|
||||
extern inline ALuint maxu(ALuint a, ALuint b);
|
||||
extern inline ALuint clampu(ALuint val, ALuint min, ALuint max);
|
||||
|
@ -64,6 +64,13 @@ inline ALfloat maxf(ALfloat a, ALfloat b)
|
||||
inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max)
|
||||
{ return minf(max, maxf(min, val)); }
|
||||
|
||||
inline ALdouble mind(ALdouble a, ALdouble b)
|
||||
{ return ((a > b) ? b : a); }
|
||||
inline ALdouble maxd(ALdouble a, ALdouble b)
|
||||
{ return ((a > b) ? a : b); }
|
||||
inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max)
|
||||
{ return mind(max, maxd(min, val)); }
|
||||
|
||||
inline ALuint minu(ALuint a, ALuint b)
|
||||
{ return ((a > b) ? b : a); }
|
||||
inline ALuint maxu(ALuint a, ALuint b)
|
||||
|
Loading…
x
Reference in New Issue
Block a user