While trying to track down a particularly elusive bug, I've come across
something that I'm hoping is something stupid I'm doing.

Because if I'm right in what I'm seeing, ColdFusion can't count properly.

The situation:

<cfset Result = (val(1stNumber) / val(2ndNumber)) + val(3rdNumber)>

1stNumber = -5
2ndNumber = 0.3528
3rdNumber = 14.1723356009

ie: (-5 / 0.3528) + 14.1723356009

The result *should* be 0, or as close as makes no differnce.

The result I'm getting? -7.02904401351E-012



That is pretty close to zero! In fact much closer to zero than the ones where you've trimmed down the 3rd Number....


I've put up a page to test what I'm seeing, here:
(http://devtest.formstar.com/test/a_calctest.cfm)
I've put the code at the bottom of the output.

It's not until I trim the 3rdNumber down to 14.172 that I'm
getting anything like a reasonable result.

I get the same results on both CFMX 6.0 and 6.1

Is it me? Is it CF? Is it an obscure setting I've overlooked?


Paul Haddon Technical Services Manager Formstar Print Technologies





---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004




-- Laszlo Simity www.ObjectMastery.com


--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to