mIRC Home    About    Download    Register    News    Help

Print Thread
#163616 02/11/06 02:14 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
i realize of course it doesn't make sense for $rand to support decimals, but if you try //echo -a $rand(1.1,1.7) for example, you'll run into 3 on average 1/8 of the time (according to some quick tests), 1 about 1/4 of the time, and 2 the rest

isn't it standard for identifiers that don't accept decimals to take the integer value of the given parameters, so $rand(1.1,1.7) would be interpreted as $rand(1,1)? this behavior wouldn't be explained by the numbers being rounded to the nearest integer since 3 shows up, then there's the seemingly weighted randomness :S i wonder wats happening


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
#163617 02/11/06 03:09 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Good catch, where the hell does that 3 come from haha.


$maybe
#163618 02/11/06 08:44 PM
Joined: Jan 2006
Posts: 468
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
Good catch!

#163619 02/11/06 09:03 PM
Joined: Dec 2002
Posts: 5,424
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,424
Thanks this has been fixed for the next version.

#163620 03/11/06 01:25 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
good catch! catch??


Kind Regards, blink

Link Copied to Clipboard