Cd(__DIR__);; //----------------------------------------------------------------------------- // CosF32 /* This test depends on the HolyGL library for graphing. */ F32 q0 = CosF32(F64ToF32(0.785398)); F32 q1 = CosF32(F64ToF32(2.35619)); F32 q2 = CosF32(F64ToF32(3.92699)); F32 q3 = CosF32(F64ToF32(5.49779)); "Cos(45deg) CosF32: %n | Cos: %n\n", F32ToF64(q0), Cos(0.785398); "Cos(135deg) CosF32: %n | Cos: %n\n", F32ToF64(q1), Cos(2.35619); "Cos(225deg) CosF32: %n | Cos: %n\n", F32ToF64(q2), Cos(3.92699); "Cos(315deg) CosF32: %n | Cos: %n\n", F32ToF64(q3), Cos(5.49779); CGLTex2D graph; GLTex2DInit(&graph, GL_TEX2D_RAW, 600, 512); GLTex2DColorFill(&graph, 0xFFFFFF); GLBindColorTarget(&graph); F64 temp = (pi / 2) * 100.0; GLDrawLine(temp, 0, temp, 512, 0x00FF00); F64 temp = (2 * pi / 2) * 100.0; GLDrawLine(temp, 0, temp, 512, 0x00FF00); F64 temp = (3 * pi / 2) * 100.0; GLDrawLine(temp, 0, temp, 512, 0x00FF00); I64 i; F64 angle; F64 result; for (i = 0; i < 600; i++) { angle = i * 0.01; result = Cos(angle); result *= -100.0; result += 256; GLDrawPixel(i, result, 0xFF0000); result = F32ToF64(CosF32(F64ToF32(angle))); result *= -100.0; result += 256; GLDrawPixel(i, result, 0x0000FF); } while (CharScan() == 0) { GLTex2DDebugDisp(&graph, 16, 16); Sleep(1); } //-----------------------------------------------------------------------------