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,27 @@
#include <math.h>
#define IGREG (15+31L*(10+12L*1582))
long julday(mm,id,iyyy)
int id,iyyy,mm;
{
void nrerror();
long jul;
int ja,jy=iyyy,jm;
if (jy == 0) nrerror("julday: there is no year zero.");
if (jy < 0) ++jy;
if (mm > 2) {
jm=mm+1;
} else {
--jy;
jm=mm+13;
}
jul = (long) (floor(365.25*jy)+floor(30.6001*jm)+id+1720995);
if (id+31L*(mm+12L*iyyy) >= IGREG) {
ja=(int)(0.01*jy);
jul += 2-ja+(int) (0.25*ja);
}
return jul;
}
#undef IGREG