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,24 @@
#include <cmath>
#include "nr.h"
using namespace std;
int NR::julday(const int mm, const int id, const int iyyy)
{
const int IGREG=15+31*(10+12*1582);
int ja,jul,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 = int(floor(365.25*jy)+floor(30.6001*jm)+id+1720995);
if (id+31*(mm+12*iyyy) >= IGREG) {
ja=int(0.01*jy);
jul += 2-ja+int(0.25*ja);
}
return jul;
}