import random
import math


def expo(fmean):
    """Returns a random value exponentially distributed with the specified mean."""
    d = 0.0;
    while d == 0.0:
        d = random.uniform(0,1)
    return -math.log( d ) * fmean;