using fteqcc?
random() returns 0-1
random(5) returns 0-5
random(5,10) returns 5-10
its a hexenc feature that fteqcc emulates with a formula much like you specified.
unlike that function, fteqcc has no special check for the min/max value, which means it works with any range you specify, even inverted ranges, so you might want to validate that still.
note that some engines will never return 1 from basic random, while vanilla-like engines can. This change is useful when the random value is then floored and used as an array index. the vanilla-like engines may end up trying to read out of bounds, while an engine that never returns 1 will be fine in this case.