ultimatepp/autotest/NaNINF/NaNInf.cpp
cxl 6d3aa8ba61 Creating the *real* autotest nest
git-svn-id: svn://ultimatepp.org/upp/trunk@7141 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2014-04-02 18:36:01 +00:00

31 lines
481 B
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
double d = 0;
ASSERT(!IsNaN(d));
ASSERT(!IsInf(d));
ASSERT(IsFin(d));
d = sqrt(StrDbl("-1.0"));
ASSERT(IsNaN(d));
ASSERT(!IsInf(d));
ASSERT(!IsFin(d));
d = 1e300;
d *= d;
ASSERT(!IsNaN(d));
ASSERT(IsInf(d));
ASSERT(!IsFin(d));
d = 1e300;
d *= -d;
ASSERT(!IsNaN(d));
ASSERT(IsInf(d));
ASSERT(!IsFin(d));
LOG("Everything OK");
}