瀏覽代碼

test: do the trigonometry tests on doubles instead of floats.

legacy
Sam Hocevar sam 13 年之前
父節點
當前提交
6ed53d9868
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. +4
    -4
      test/trig.cpp

+ 4
- 4
test/trig.cpp 查看文件

@@ -41,18 +41,18 @@ public:
{
for (int i = -10000; i < 10000; i++)
{
float f = (float)i * (1.0f / 1000.0f);
double f = (double)i * (1.0 / 1000.0);
double a = __builtin_sin(f);
double b = lol_sin(f);
CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-10f);
CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-11);
}

for (int i = -10000; i < 10000; i++)
{
float f = (float)i * (1.0f / 100000.0f);
double f = (double)i * (1.0 / 100000.0);
double a = __builtin_sin(f);
double b = lol_sin(f);
CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-10f);
CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-11);
}
}
};


Loading…
取消
儲存