[ic] Really strange [calc] evaluation

Daniel Browning db at endpoint.com
Tue Jan 26 23:11:57 UTC 2010


On Tuesday 26 January 2010 2:57:11 pm Grant wrote:
> The following should evaluate to zero:
> 
> [calc]197.7 - (32.95 * 6)[/calc]
> 
> but instead I get:
> 
> -2.8421709430404e-14
> 
> Everything else is functioning normally.  Does anyone know what's
> going on here?  I'm on 5.6.1.

Standard floating point arithmetic. Same thing occurs in every programming 
language that uses FP. Use rounding (printf) or CPAN modules to handle it.
-- 
Daniel Browning
End Point Corporation
http://www.endpoint.com/



More information about the interchange-users mailing list