mirror of https://gitlab.com/rnger/amath
Included MorphOS patch
This commit is contained in:
parent
2ee6693905
commit
3ab236f0b0
14
libm/rprim.h
14
libm/rprim.h
|
@ -296,26 +296,24 @@ double log(double x);
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline double
|
double sgn(double x)
|
||||||
sgn(double x)
|
|
||||||
{
|
{
|
||||||
return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;
|
return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline double
|
double trunc(double x)
|
||||||
trunc(double x)
|
|
||||||
{
|
{
|
||||||
return x > 0.0 ? floor(x) : ceil(x);
|
return x > 0.0 ? floor(x) : ceil(x);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline double
|
double round(double x)
|
||||||
round(double x)
|
|
||||||
{
|
{
|
||||||
return x > 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
|
return x > 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline double
|
double log(double y, double x)
|
||||||
log(double y, double x)
|
|
||||||
{
|
{
|
||||||
return log(x)/log(y);
|
return log(x)/log(y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue