fixed intRanged formula; previously had only half the correct chance of returning min or max value