Expr::random limited to 16 bits?

Jul 18, 2006 at 11:42am

Expr::random limited to 16 bits?

Hello,

Max 4.5.7
OS 10.3.9

The random function in an [expr] seems to be limited to signed 16-bit operation, after which it wraps. Is this by design?

Expected behaviour: more range, in common with the rest of the environment.

Steps to reproduce:
#P window setfont “Sans Serif” 10.;
#P number 260 376 63 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 186 372 63 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 262 348 57 196618 minimum;
#P newex 183 346 58 196618 maximum;
#P newex 165 317 74 196618 zl group 120;
#P user multiSlider 165 424 336 90 -65000. 65000. 120 2937 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 163 281 129 196618 expr random($i1\,$i2);
#P newex 179 143 48 196618 * 1000;
#P newex 179 175 56 196618 + 25000;
#N counter;
#X flags 0 0;
#P newobj 179 116 66 196618 counter;
#P newex 199 219 27 196618 + 1;
#P button 179 59 15 0;
#P newex 179 88 49 196618 uzi 120;
#P connect 8 0 7 0;
#P connect 8 0 9 0;
#P connect 8 0 10 0;
#P connect 9 0 11 0;
#P connect 10 0 12 0;
#P connect 6 0 8 0;
#P connect 4 0 6 0;
#P connect 4 0 2 0;
#P connect 2 0 6 1;
#P connect 5 0 4 0;
#P connect 0 0 3 0;
#P connect 3 0 5 0;
#P connect 1 0 0 0;
#P window clipboard copycount 13;

workarounds:
use built in random object, or litter, or scale outputs, or…

#26839

You must be logged in to reply to this topic.