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

Function assertTrueD

source/test/testFPU.cpp:137–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void assertTrueD(double d1, double d2) {
138 FPU_Double bits1;
139 FPU_Double bits2;
140 bits1.d = d1;
141 bits2.d = d2;
142 if (bits1.l == bits2.l) {
143 return;
144 }
145 if (d1 == d2) {
146 return;
147 }
148 double diff = d1 > d2 ? d1 - d2 : d2 - d1;
149 if (diff < .0000001) {
150 return;
151 }
152 double e = d1 > d2 ? d2 / 100000.0 : d1 / 100000.0;
153 if (e < 0) {
154 e = -e;
155 }
156 if (diff < e) {
157 return;
158 }
159 assertTrue(0);
160}
161
162static U8 rm(int ea, int group, int sub) {
163 int result = (group & 7) << 3 | (sub & 7);

Callers 1

doFPREMnearestFunction · 0.85

Calls 1

assertTrueFunction · 0.85

Tested by

no test coverage detected