MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / assertTrueF

Function assertTrueF

source/test/testFPU.cpp:115–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113};
114
115void assertTrueF(float f1, float f2) {
116 FPU_Float bits1;
117 FPU_Float bits2;
118 bits1.f = f1;
119 bits2.f = f2;
120 if (bits1.i == bits2.i) {
121 return;
122 }
123 if (f1 == f2) {
124 return;
125 }
126 float diff = f1 > f2 ? f1 - f2 : f2 - f1;
127 if (diff < .000001f) {
128 return;
129 }
130 float e = f1 > f2 ? f2 / 100000.0f : f1 / 100000.0f;
131 if (diff < e) {
132 return;
133 }
134 assertTrue(0);
135}
136
137void assertTrueD(double d1, double d2) {
138 FPU_Double bits1;

Callers 3

doFPTANFunction · 0.85
doFATANFunction · 0.85
doFXTRACTFunction · 0.85

Calls 1

assertTrueFunction · 0.85

Tested by

no test coverage detected