View comments | RSS feed
Contents > Developing ColdFusion MX Applications > Using ColdFusion Variables > Data types > Numbers Integers PreviousNext

Integers

ColdFusion supports integers between -2,147,483,648 and 2,147,483,647 (32-bit signed integers). You can assign a value outside this range to a variable, but ColdFusion initially stores the number as a string. If you use it in an arithmetic expression, ColdFusion converts it into a floating point value, preserving its value, but losing precision as the following example shows:

<cfset mybignum=12345678901234567890>
<cfset mybignumtimes10=(mybignum * 10)>
<cfoutput>mybignum is: #mybignum#</cfoutput><br>
<cfoutput>mybignumtimes10 is: #mybignumtimes10# </cfoutput><br>

This example generates the following output:

mybignum is: 12345678901234567890
mybignumtimes10 is: 1.23456789012E+020


Contents > Developing ColdFusion MX Applications > Using ColdFusion Variables > Data types > Numbers Integers PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


pikala_ said on Jul 14, 2004 at 5:19 AM :
But unfortunately this doesn't work for all functions.

eg both of following lines fail with above example:

<cfset tmp = mybignumtimes10 MOD 10>
<cfset hex = FormatBaseN(mybignumtimes10,16)>

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/variabl7.htm