Archive for the ‘coding’ Category

Skewing random numbers towards 0

2006.05.29, Mon

A quick way to skew random numbers towards 0 is to raise them to some powers – the higher the power, the higher the skew.

var num:Number    = Math.pow( Math.random(), 2 );