exp_dist

! NOTE: This script is under review. See this topic for more infomation.

Downloadexp_dist(x)   Returns a random number from 0 to x with an exponential ditribution.
/*
**  Usage:
**      exp_dist(x)
**
**  Arguments:
**      x       upper bound of desired random value
**  Returns:
**      a random number from 0 to x with an exponential ditribution
**
**  GMLscripts.com
*/

{
    return argument0 * (-ln(random(1)))
}

Click if you've used this script[Please Login]
Projects: 8

 Contributor: pedrosorio

 History:
Dec 31, 2007 - pedrosorio submits original script
Jul 31, 2009 - xot places script under review


comments powered by Disqus