ajitnk wrote:
> 
> Is there any way to prevent rounding off OR do i have to use different data
> type ?

As the other posters have said, floating point numbers aren't the right
thing if you need exact representations.

That said, on the Palm platform you can have both single-precision and
double-precision floating point variables.  I find that with doubles, I
don't get a significant amount of precision error in my programs, but
with single-precision floats, I can easily see bad precision.  

For example, pow(sqrt(2), 8) should yield 16.0, and it does when you use
the double-precision MathLib version of pow() and sqrt().  If instead
you use PRC-Tools' single-precision math library, you get  15.999996....
or something like that.  
--
= Warren Young -- Maintainer of the Palm OS Programmer's FAQ at:
=     http://www.cyberport.com/~tangent/palm/faq/
=
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to