mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Fix pico_divider_nesting_test.c on RP2350 - was broken due to running faster and hence further on RP2350, breaking a check which was wrong for larger inputs
This commit is contained in:
parent
a62d17cb42
commit
f20663cb7f
1 changed files with 9 additions and 2 deletions
|
|
@ -47,7 +47,15 @@ bool timer_callback(repeating_timer_t *t) {
|
||||||
// if (fabs(fz - (fa * 11.0f + fb)) > 1e-9f) {
|
// if (fabs(fz - (fa * 11.0f + fb)) > 1e-9f) {
|
||||||
// FAILED();
|
// FAILED();
|
||||||
// }
|
// }
|
||||||
if (fabsf(fz - fa * 11.0f) > 1e-3f) {
|
union {
|
||||||
|
float f;
|
||||||
|
uint32_t i;
|
||||||
|
} fi, fi2;
|
||||||
|
fi.f = fabsf(fz - fa * 11.0f);
|
||||||
|
// make a float which is close to 1ulp
|
||||||
|
fi2.i = fi.i & 0x7f800000u;
|
||||||
|
fi2.i++;
|
||||||
|
if (fi.f > fi2.f) {
|
||||||
FAILED();
|
FAILED();
|
||||||
}
|
}
|
||||||
double dz = z;
|
double dz = z;
|
||||||
|
|
@ -258,4 +266,3 @@ int main() {
|
||||||
printf("PASSED\n");
|
printf("PASSED\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue