MMike: floats have a maximum precision of about 6 digits, vars 9 digits, and doubles 14 digits.
There is no variable with 20 digits precision. Constants in the script are either floats or integers. When you get syntax errors, something's wrong with your version or your code.
JCL, i don't know if the problem is or not with the code? i just used the EvilSob code.. But does it work on your side??
im using Version 7.73 13-Mar-2009 (did not updated to 7.80 because in my case, the known bugs are not a problem at the moment, and i went to check and there are no bugs related to this this). Well i can update anyway, But first tell me if its a version problem or not.
Well,I tried to check the origin of the error..
This is EvilSob code:
function whatever()
{
double values[6];
values[0] = (double)2.862738448796;
values[1] = (double)-8.642801642417908;
diag_var("p1 = %.9f x ", (double)values[0]); diag_var("%.9f\n", (double)values[1]);
diag_var("p2 = %.9f x ", (double)values[2]); diag_var("%.9f\n", (double)values[3]);
values[2] = (double)2.86270802130925;
values[3] = (double)-8.642629981040955;
diag_var("p1 = %.9f x ", (double)values[0]); diag_var("%.9f\n", (double)values[1]);
diag_var("p2 = %.9f x ", (double)values[2]); diag_var("%.9f\n", (double)values[3]);
}
And Sed complains here:
double values[6];
values[0] = (double)2.862738448796;
saying cant convert Double::Double
after testing that .. i ended up that the error is because of this:
function whatever()
{double val=0; val = (double)350.9898789;}
function whatever() // removing the point ...
{double val=0; val = (double)3509898789;}
(see the number is huge now 35098(...) , not 350.98.. and because of that point.. it returns that error of double..
(Is this normal?)
If i change this to...
function whatever() //changing double to float
{double val=0; val = (float)350.9898789;}
it compiled just fine..
__________________________________________
Second thing is:
Ok one reason i never got aware of this limitation is because that table is confusing, at least for me.. because this is what i learn on school:
as the manual it says : range minimum
float 4 bytes -3.4e38 to 3.4e38 1.2e-38
I though this means 3.4 x 10 ^38 which means.. in scientific notations.
and typing on my university calculator.. 0.0000000(...38 zeros)34 , which is around 35 decimals.