Changeset 894


Ignore:
Timestamp:
Sep 3, 2011, 7:45:10 PM (8 years ago)
Author:
sam
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/trig.cpp

    r889 r894  
    4242        for (int i = -10000; i < 10000; i++)
    4343        {
    44             float f = (float)i * (1.0f / 1000.0f);
     44            double f = (double)i * (1.0 / 1000.0);
    4545            double a = __builtin_sin(f);
    4646            double b = lol_sin(f);
    47             CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-10f);
     47            CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-11);
    4848        }
    4949
    5050        for (int i = -10000; i < 10000; i++)
    5151        {
    52             float f = (float)i * (1.0f / 100000.0f);
     52            double f = (double)i * (1.0 / 100000.0);
    5353            double a = __builtin_sin(f);
    5454            double b = lol_sin(f);
    55             CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-10f);
     55            CPPUNIT_ASSERT(fabs(a - b) <= fabs(f) * 1e-11);
    5656        }
    5757    }
Note: See TracChangeset for help on using the changeset viewer.