//---------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_VALUES 6000
#include <vcl.h>
#pragma hdrstop
////////////////////////使用前 必須對srand(讓其對時間有變化)
///////////////////////n不能等於1
float rand_normal1(void);
void rand_normal2(float* n1, float* n2);
//---------------------------------------------------------------------------
/*
Normal.c-Standard Normal Random Numbers
This program generates random numbers from a standard
normal distribution using a) the central limit theorem,
and b) the Box-Muller algorithm.
*/
#pragma argsused
int main(int argc, char* argv[])
{
float x[MAX_VALUES]; //array containing random nubers
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_VALUES 6000
#include <vcl.h>
#pragma hdrstop
////////////////////////使用前 必須對srand(讓其對時間有變化)
///////////////////////n不能等於1
float rand_normal1(void);
void rand_normal2(float* n1, float* n2);
//---------------------------------------------------------------------------
/*
Normal.c-Standard Normal Random Numbers
This program generates random numbers from a standard
normal distribution using a) the central limit theorem,
and b) the Box-Muller algorithm.
*/
#pragma argsused
int main(int argc, char* argv[])
{
float x[MAX_VALUES]; //array containing random nubers