Integers in Java (for CFMX) and C/C++ (in the case of v5 or below) are
32 bit.

32 bit signed integers have a positive limit of about 2^31-1, and
negative limit of about 2^31. (My 2's complement may be a little off.
:P)

Anyway, 2^31 is about 2 billion. 10000000000 is 10 billion. :D

ColdFusion stores/converts all overflowed integers to FLOAT in
arithmetic expressions, and you lose precision.

In short, you have an integer overflow. :P

-------------------------------
James Ang
Sr. Developer/Product Engineer
MedSeek, Inc.
[EMAIL PROTECTED]



-----Original Message-----
From: charlie griefer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 25, 2003 12:26 PM
To: CF-Talk
Subject: CF error...Cannot convert 10000000000 to integer


Hey folks: 

working on a function to convert a decimal number to a fraction. 

everything's working fine, unless the number passed to the function has
MORE 
than 9 decimal places.  If 10 decimal places, i get: 

Error Occurred While Processing Request
Cannot convert 10000000000 to integer 

The function can be seen here:
http://charlie.griefer.com/decimal_to_fraction.cfm 


Is this something wrong in the code?  Or a ceiling on CF and integers? 

Also...just curious...if you were using this function, and passed .33 to
it, 
would you rather get back 33/100 (accurate), or 1/3 (more generally 
accepted)? 

tia,
charlie

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to