add numerical recipes library

This commit is contained in:
2025-09-12 18:55:25 +09:00
parent d4dff245bd
commit 2c75620ec9
1344 changed files with 63869 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
/* Driver for routine ran4 */
#include <stdio.h>
#define NRANSI
#include "nr.h"
int main(void)
{
int i;
static long idum[5]={0,-1,99,-99,99};
static char *ansvax[5]={"","0.275898","0.208204","0.034307","0.838676"};
static char *ansiee[5]={"","0.219120","0.849246","0.375290","0.457334"};
float random[5];
for (i=1;i<=4;i++) random[i]=ran4(&idum[i]);
printf("ran4 gets values: ");
for (i=1;i<=4;i++) printf("%15.6f",random[i]);
printf("\n IEEE answers: ");
for (i=1;i<=4;i++) printf("%15s",ansiee[i]);
printf("\n VAX answers: ");
for (i=1;i<=4;i++) printf("%15s",ansvax[i]);
printf("\n");
return 0;
}
#undef NRANSI