Example #1
0
static void testDivision() {
    testDivision(1, 2, "0.500000");
    testDivision(100, -100, "-1.000000");
    testDivision(100, -10, "-10.000000");
    testDivision(0, 0, "nan");
    testDivision(-0, 0, "nan");
    testDivision(0, -0, "nan");
    testDivision(1, 0, "inf");
    testDivision(1, 123456789, "0.000000");
    testDivision(0.5, 1.5, "0.333333");
    testDivision(0.5, 1.2, "0.416667");
}
Example #2
0
static void run() {
    testSum();
    testSubtraction();
    testMulitplication();
    testDivision();
    testSign();
}
Example #3
0
int main()
{
    testDivision();

    length_type MAP_SIZE = length_type(64.f * 533.333f);

    Point center = {MAP_SIZE/2, MAP_SIZE/2};
    QuadTree * tree = QuadTree::create(8, center, MAP_SIZE);
    if (!tree)
        return 0;

    tree->debugSelf();

    Circle c = {MAP_SIZE/2, MAP_SIZE/2, 1};
    TreeVisitor visitor = {tree};
    AABox2d box(AABox2d::create(c));
    tree->intersectRecursive(box, visitor);
    tree->intersect(box, visitor);



    QuadIterator it = tree->deepestContaining(AABox2d::create(c));

    _getch();
    return 0;
}
Example #4
0
void test(){
	testAdd();
	testSub();
	testMult();
	testScale();
	testEquals();
	testDivision();
	testAbsolute();
	testArgument();
	printf("All passed!\n");
}
Example #5
0
int main (int argc, char* argv[]) {
    (void)argc;
    (void)argv;
    initializeRegisters(registers, numReg);
    testConditionalMove();
    testAddition();
    testMultiplication();
    testDivision();
    testBitwiseNAND();
    testLoadVal();
    testIO();
    //testHalt();
    //printf("Failure! Did not halt.\n");
    return 0;
}
Example #6
0
int testRealNumber() {
   cout << "Testing RealNumber... ClassBasics \t- "
      << (testClassBasics() ? "OKAY" : "FAILURE")
      << endl;
   cout << "Testing RealNumber... Addition \t\t- "
      << (testAddition() ? "OKAY" : "FAILURE")
      << endl;
   cout << "Testing RealNumber... Subtraction \t- "
      << (testSubtraction() ? "OKAY" : "FAILURE")
      << endl;
   cout << "Testing RealNumber... Multiplication \t- "
      << (testMultiplication() ? "OKAY" : "FAILURE")
      << endl;
   cout << "Testing RealNumber... Division \t\t- "
      << (testDivision() ? "OKAY" : "FAILURE")
      << endl;

   cout << endl;
   return 0;
}