Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 9, 2007, 09:26 AM   #1
vgoklani
macrumors regular
 
Join Date: Jul 2004
Send a message via AIM to vgoklani
Generating normally distributed random numbers in C++

Hi,

I would like to generate normally distributed (as opposed to uniformly distributed) random numbers in C++ - is there a library function that would accomplish this? I am using the g++ compiler that comes installed with XCode.
vgoklani is offline   0 Reply With Quote
Old Mar 9, 2007, 09:56 AM   #2
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
Quote:
Originally Posted by vgoklani View Post
Hi,

I would like to generate normally distributed (as opposed to uniformly distributed) random numbers in C++ - is there a library function that would accomplish this? I am using the g++ compiler that comes installed with XCode.
Hmm, you could easily write your own code.

Look at this page. It gives a formula for how to do it.
Eraserhead is offline   0 Reply With Quote
Old Mar 9, 2007, 11:23 AM   #3
vgoklani
Thread Starter
macrumors regular
 
Join Date: Jul 2004
Send a message via AIM to vgoklani
I thought about using Numerical Recipes, but thanks for the link!
vgoklani is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Using race conditions to generate a better random number? GorillaPaws Mac Programming 17 Jun 7, 2010 04:47 AM
Random numbers in Fortran 90 Spanky Deluxe Mac Programming 0 Aug 14, 2009 05:23 AM
Xcode C++ help! A real random number generator unknown.exe Mac Programming 12 Jan 6, 2008 11:00 AM
random number generator in Excel for Mac mmoin General Mac Discussion 1 Feb 11, 2003 08:57 PM


All times are GMT -5. The time now is 02:21 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC