#define Rand0To1() (( rand() & 32767 ) * ( 1.0f / 32767.0f )) Works fine for me but does return 1 sometimes Brett __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com