Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Coldfusion Rand function 0 included, 1 excluded?

15 views
Skip to first unread message

ElKlaaso

unread,
Apr 13, 2012, 9:13:55 AM4/13/12
to
Hi,

The java random function specifies very clearly what it returns:
(http://docs.oracle.com/javase/6/docs/api/java/lang/
Math.html#random())

0.0 included, 1 excluded.

But the adobe coldfusion rand(algorithm) function documentation doesnt
specify this.
Can i safely assume this is exactly the same as java.math.random ?

greets,
klaas

IRC

unread,
Apr 20, 2012, 8:53:54 AM4/20/12
to
Elass,

Yes, you can use that to work for random. But, it should be rand()
rather than random();
So, you can try with this.

<cfset random=RAND()>

<cfoutput>#random#</cfoutput>
0 new messages