This adds the required functions to libroot.so and fixes DEBUG build.
Unfortunately, they are pretty broken, so I added them into floatmath.c git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14019 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -46,6 +46,8 @@ float scalbf(float x, float n) {return (float)scalb((double)x, (double)n);};
|
|||||||
double
|
double
|
||||||
modf(double x, double *y)
|
modf(double x, double *y)
|
||||||
{
|
{
|
||||||
|
// TODO: this truncates to int precision and is broken!
|
||||||
|
// this should be implemented arch dependent!
|
||||||
int integer = (int)x;
|
int integer = (int)x;
|
||||||
*y = (double)integer;
|
*y = (double)integer;
|
||||||
return x - integer;
|
return x - integer;
|
||||||
@@ -54,8 +56,39 @@ modf(double x, double *y)
|
|||||||
float
|
float
|
||||||
modff(float x, float *y)
|
modff(float x, float *y)
|
||||||
{
|
{
|
||||||
|
// TODO: this truncates to int precision and is broken!
|
||||||
|
// this should be implemented arch dependent!
|
||||||
double intpart = 0;
|
double intpart = 0;
|
||||||
float result = (float)modf((double)x, &intpart);
|
float result = (float)modf((double)x, &intpart);
|
||||||
*y = (float)intpart;
|
*y = (float)intpart;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
__signbitf(float value)
|
||||||
|
{
|
||||||
|
// TODO: this is broken on most non x86 machines
|
||||||
|
// this should be implemented arch dependent!
|
||||||
|
union { float v; int i; } u = { v: value };
|
||||||
|
return u.i < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
__signbit(double value)
|
||||||
|
{
|
||||||
|
// TODO: this is broken on most non x86 machines
|
||||||
|
// this should be implemented arch dependent!
|
||||||
|
union { double v; int i[2]; } u = { v: value };
|
||||||
|
return u.i[1] < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
__signbitl(long double value)
|
||||||
|
{
|
||||||
|
// TODO: this is broken on most non x86 machines
|
||||||
|
// this should be implemented arch dependent!
|
||||||
|
union { long double v; int i[2]; } u = { v: value };
|
||||||
|
return (u.i[2] & 0x8000) != 0;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user