Hello
as i saw here : http://www.keil.com/support/man/docs/ca/ca_rand.htm The rand function generates a pseudo-random number between 0 and 32767. the rand range is 0-32767.
so why i get bigger number ?
Best Regards
Do you? How?
Yes i have very simply i just send "rand()" return through serial an got bigger number !
anyone else had this experience ?
Did you send the value as text (using sprintf() or similar)? Or did you send the value as two bytes binary? In which case you might have flipped the byte order.
May be it would help if you provided your test case code, and the output you observe. Include with it a description of the micro-processor you are using, and the version of the compiler/library involved.
If you frame better questions/observations, you are likely to get better responses, than to describe some vague malady and hope some other lost soul has encountered it.
Isn't the range defined by RAND_MAX, and isn't that 0x7FFFFFFF in your situation?
A bit interesting that the link in the original post is to the CARM compiler.
With a clear red "Discontinued" displayed.
View all questions in Keil forum