Urandom_range () doubt

Hi Sir
I wanted to use $urandom_range() to generate random voltages, but I was unable to implement my idea.
when min<0, result is falut;
when max<0,min <0 result is right.

Code that does not achieve the desired result: range(2.4,-0.1)
int a;
real b;
real min_voltage = -0.1;
real max_voltage = 2.4;

always_ff @(posedge clk)
begin
a = $urandom_range(int’(min_voltage10000.0), int’(max_voltage10000.0));
b = a/10000.0;
$display (“a = %f ,b =%f”,a,b);
end

sim log :
a = 1582722508.000000 ,b =158272.250800
a = 1996166642.000000 ,b =199616.664200
a = 1711659725.000000 ,b =171165.972500

I guess urandom_range returns an unsigned value, so min must be >0, but I changed range to (-0.1, -2.4), and this function generates the correct voltage.
range (-0.1,-2.4): sim log:
a = -15525.000000 ,b =-1.552500
a = -13310.000000 ,b =-1.331000
a = -14834.000000 ,b =-1.483400
a = -14261.000000 ,b =-1.426100
a = -14802.000000 ,b =-1.480200
a = -7197.000000 ,b =-0.719700

coulde you hele me to resolve the doubt?
when min<0, result is falut;
when max<0,min <0 result is right.
Thanks~

In reply to ncui:

The functions $urandom() and $urandom_range() are specified to work only with unsigned integers. Your results will be undefined when you use signed integers as arguments.