Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 64980
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

What's wrong with C rand()?

March 9th, 2016, 7:29 pm

"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
Alan
Posts: 10712
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

What's wrong with C rand()?

March 9th, 2016, 8:59 pm

Well, there is a lengthy discussion in my old (1992) copy of Numerical Recipes. I remember it scared me off it, so I always use their ran2
 
User avatar
Hansi
Posts: 3300
Joined: January 25th, 2010, 11:47 am

What's wrong with C rand()?

March 9th, 2016, 9:00 pm

 
User avatar
Cuchulainn
Topic Author
Posts: 64980
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

What's wrong with C rand()?

March 10th, 2016, 9:24 am

Thanks.My post is more like a historical note but the top 5 blemishes in rand() should not be repeated with other pseudo RNG (PRNG).Here was a great thread VBA versus C 1. not thread-safe2. repeats itself, i.e. 'random' numbers come back
Last edited by Cuchulainn on March 9th, 2016, 11:00 pm, edited 1 time in total.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
Cuchulainn
Topic Author
Posts: 64980
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

What's wrong with C rand()?

March 11th, 2016, 8:34 pm

QuoteOriginally posted by: AlanWell, there is a lengthy discussion in my old (1992) copy of Numerical Recipes. I remember it scared me off it, so I always use their ran2I think is a straight code port from their 1989 FORTRAN version of the book.
Last edited by Cuchulainn on March 10th, 2016, 11:00 pm, edited 1 time in total.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl