> It's a fairly easy situation to reproduce (I shall try
> to find an example).
Found it.
<code>
Apparently in CF (123.45 - 23.4) <> 100.05...<br /><br />
<strong>Using CF "typeless" floats</strong><br />
<cfset f1 = 123.45>
<cfset f2 = 23.4>
<cfset f3 = 100.05>
<cfset f4 = f1 - f2>
<cfset b1 = (f1 - f2) eq f3>
<cfset b2 = f4 eq f3>
<cfoutput>
f1: [#f1#]<br />
f2: [#f2#]<br />
f3: [#f3#]<br />
f4: #f1# - #f2#: [#f4#]<br />
b1: (#f1# - #f2#) eq #f3#: [#b1#]<br />
b2: #f4# eq #f3#: [#b2#]<br />
</cfoutput>
<hr />
</code>
I did some variations of this using javaCast() on f1-4, and then knocked
some simple Java classes together to use pure Java (one using floats, one
using doubles) for setting all the variables (ie: no computation done with
CF; only output). Similar results, although - tellingly - using
javaCast("float") or native floats in Java yielded this:
f4: 123.45 - 23.4: [100.049995]
--
Adam
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/