Hi!
> Because (SysRandom(0) * 4096) yields a 16-bit number, not a 32-bit number
as
> you may be expecting, and sysRandomMax is 0x7FFF, so 0 and 1 are the only
> possible results of the division.
How do I force the OS to make the product 32-bit?
> > I need to generate a random number between 0 to 4095.
> Consider: SysRandom( 0 ) % 4096
Simple soln which I never thought of, thanks! :)
> > The other thing is: since sysRandomMax in OS3.5 is 9999,
> > while it is 32767 in the older OSes
> Huh? sysRandomMax is still 0x7FFF == 32767 in 3.5 and 4.0.
Hahah, I just realised. :) My code ran with only 4 digits when I placed it
in an OS3.5 ROM and 5 digits in an OS3.3 ROM, weird. :)
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/