Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fiddling around with random #s and odds.
#21
Quote:Did you ever installed one of the updates mintained by Eric Cowles (1000101) or before November, by Pritchard? If you did that you are using the new RND
Thx. Had no idea rnd was even changed.
Reply
#22
Quote:So you're saying that my version of FB is unable to generate 0.617283 because the RND function doesn't generate numbers to that precision?

Yes, and not only your version of FB, also the Visual C compilers by Microsoft. It's how msvcrt71.dll works. QB had more precission.

It has been documented in the wiki for a year, and updated recently to cover version 0.17, as this version is close to be released.
Antoni
Reply
#23
That's what I get for belittling CVS. Thanks Antoni.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#24
Part of the problem is that the C library's rand() (which was used by the old RND) returns an integer (up to 2^16 with the MSVCRT runtime, if I remember right), which FB then converts to a floating-point value, which you then convert back to an integer...
Reply
#25
Quote:Part of the problem is that the C library's rand() (which was used by the old RND) returns an integer (up to 2^16 with the MSVCRT runtime, if I remember right), which FB then converts to a floating-point value, which you then convert back to an integer...

4 -> .000032 -> 0
2811 -> .0003984 -> 0 . . . .

lol Tongue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)