Jump to content
  • Advertisement
Sign in to follow this  

what is erand48

This topic is 3089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ive googled around but cannot find a better explanation about what is this function used for. what kind of random value does this generate? what is the difference between this and a normal random value? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
The first result from google explains it pretty well, I would have thought.

What do you mean by a "normal random value"? The Xrand48() family of functions are normal random number generators. I assume you're asking what the difference is between Xrand48() and the standard C library rand(). The problem with rand() is that the standard leaves a lot of leeway in implementation details about how rand() actually works and so while there are some good implementations, there are also many bad implementations (a "bad" implementation is one that returns numbers which aren't all that random after all). By precisely defining how Xrand48() works, you can be sure that any particular implementation is going to return numbers that are just as good as any other conforming implementation.

Share this post


Link to post
Share on other sites
so correct me if im wrong: Xrand48 (erand68) is a better implementation of random value?
what does uniformly distributed means? is it like all random value will have the same chances to be picked?


thanks in advance

Share this post


Link to post
Share on other sites
Quote:
is it like all random value will have the same chances to be picked?
Correct. In some implementations of rand(), for example, the lower bits are not particularly random, so sometimes you'd find that even numbers are picked far more often than odd numbers. Your particular implementation of rand() might be OK, but give your code to someone else to compile and all of a sudden, you'll find that your random numbers are no longer all that random...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!