ultimatepp/uppdev/dbldate/dbldate.cpp
cxl 3cd394812c Merge continued
git-svn-id: svn://ultimatepp.org/upp/trunk@10263 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-10-04 08:34:39 +00:00

16 lines
370 B
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
for(int i = 0; i < 365 * 100000; i++) {
Date d = i + Date(1, 1, 1);
double x = (d - Date(-4000, 1, 1)) * 1.0E300;
ASSERT(x >= 1.0E300);
Date d1 = int(x / 1.0E300 + 0.5) + Date(-4000, 1, 1);
ASSERT(d == d1);
if((i & 1023) == 0)
Cout() << i / 365 << " " << x << '\n';
}
}