This fixes an issue with erroneous float-to-int rounding that resulted in truncation toward 0, causing a biased distribution.