ok thanks adrian ill look into this some more richard
>I'd guess it's a precision problem. Not sure what the fix would be. I'm >guessing that you'd run into similar problems with large integers. > >Adrian > >Building a DB of errors at http://cferror.org/ > >hi, > >i have a function that is passed a float value, a min float range, and a max >float range and it compares whether the float is in the correct range and >passes back true or an error: > ><cffunction name="isValidFloatRange" hint="is passed a value, a min range, >and a max range and checks to ensure the value is in between the 2 ranges"> > <cfargument name="value" type="numeric" required="true"> > <cfargument name="minRange" type="numeric" required="true"> > <cfargument name="maxRange" type="numeric" required="true"> > > <cfif value lt minRange or value gt maxRange> > <cfreturn "Float out of range: #value# (Valid Float Range: #minRange# to >#maxRange#)"> > <cfelse> > <cfreturn true> > </cfif> > ></cffunction> > >however, it all seems to work fine until i put in the following criteria: > ><cfoutput>#isValidFloatRange(1.9999999999999999,2.00,3.00)#</cfoutput> > >for some reason it returns true saying that value is between 2 and 3. but if >i take one of the 9's out of the value then it produces the required error >saying it is not inbetween the range > >has anyone come across this before or see if there is something i am missing > >thanks > >richard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313550 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

