Original Post
i have a problem with calculating sqrt function after InitD3D (directX 9) call.
here's a part of my code - the begining of WinMain:
...
double broj=1.2345678901234567, rezul=0;
rezul=sqrt(broj*broj);
if(!d3d::InitD3D(hinstance,
Width, Height, true, D3DDEVTYPE_HAL, &Device))
{
::MessageBox(0, "InitD3D() - FAILED", 0, 0);
return 0;
}
broj=1.2345678901234567, rezul=0;
rezul= sqrt( broj * broj);
...
the problem is that before the InitD3D sqrt function returns:
rezul 1.2345678901234567 double
and after InitD3D sqrt returns:
rezul 1.2345678806304932 double
to me it seems that after InitD3D it is doing math in float not in double precision, although the type of the variable is double. float precision is not enough for me - i need double.
any explanations and solutions?
thanx,
marjan
here's a part of my code - the begining of WinMain:
...
double broj=1.2345678901234567, rezul=0;
rezul=sqrt(broj*broj);
if(!d3d::InitD3D(hinstance,
Width, Height, true, D3DDEVTYPE_HAL, &Device))
{
::MessageBox(0, "InitD3D() - FAILED", 0, 0);
return 0;
}
broj=1.2345678901234567, rezul=0;
rezul= sqrt( broj * broj);
...
the problem is that before the InitD3D sqrt function returns:
rezul 1.2345678901234567 double
and after InitD3D sqrt returns:
rezul 1.2345678806304932 double
to me it seems that after InitD3D it is doing math in float not in double precision, although the type of the variable is double. float precision is not enough for me - i need double.
any explanations and solutions?
thanx,
marjan