ultimatepp/uppdev/dbldate/dbldate.cpp
cxl 351994a6cc Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +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';
}
}