My coworker ran into this today.  We were able to reproduce it on CF 6,
7, and 8.
The variable x is equal to 6.  When passed into the int function you get
5 back.  This must be some sort of precision thing with internal
rounding.

<cfset x = (2280.66 + 0.00) / 380.11>
 
<!--- output results --->
 
<cfoutput>
(2280.66 + 0.00) / 380.11=#(2280.66 + 0.00) / 380.11#
 
<hr>
x=#x#
 
<BR>
val(x)=#val(x)#
 
<BR>
int(x)=#int(x)#
 
</cfoutput>

==================================

In related news, 

int(5.999999999999999) = 5
but, 
int(5.9999999999999999) = 6

Explanations?

I found this and it seemed to help:
http://en.wikipedia.org/wiki/Computer_numbering_formats#Representing_fra
ctions_in_binary

~Brad

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304818
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to