Thank you for that. What he is really looking for, for me, is a C/C++ solution to rounding floating point numbers(doubles) to a specific number of decimal places with the most accuracy that can be had.
An Example of this is below.
double MyRound(double Value, int NumPlaces)
{
double Factor;
long Temp;
Factor = pow(10.0, NumPlaces);
Temp = (Value * Factor) + 0.5;
return Temp / Factor;
}
Using the above code 8.745 rounds to 8.74, instead of the expected(based on what my math teacher in 2nd grade said) 8.75. Why? Well because 8.745 is passed in as 8.744999999999999200 and multiplying by 100 gives you 874.499999999999890000 which if you add .5 gives you 874.999999999999890000 which when cast to a long gives you 874. divide by 100 and you get 8.74
Now that is just a simple rounding function, and may be considered bad coding by some, but it displays the problem that I am trying to work around.
The Calculator that you referenced earlier does not use doubles, as far as I can tell, to do it's math as doubles are limited to numbers between 2.2-308 and 1.8e308. Since she can do numbers that contain hundreds of thousands of digits that rules out the use of doubles. but on a side note thank you for posting that as it may be useful to me personally.
-Ray