Quellcode durchsuchen

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

legacy
Sam Hocevar sam vor 13 Jahren
Ursprung
Commit
6ed53d9868
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. +4
    -4
      test/trig.cpp

+ 4
- 4
test/trig.cpp Datei anzeigen

@@ -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);
}
}
};


Laden…
Abbrechen
Speichern