[PATCH] Fix remainder calculating bug in single floating point division
Liu Yu
Yu.Liu at freescale.com
Wed Jan 9 12:24:07 EST 2008
>
> can you provide the test case that shows the error.
>
It seems that math-emu only be used for MPC8xx on current kernel.
---
#include <stdio.h>
#include <math.h>
#include <bits/nan.h>
#include <bits/inf.h>
void
fdiv(float f, float f1, float expected)
{
float f2;
f2 = f / f1;
printf("fdiv %e / %e = %e expected %e %s \n", f, f1, f2, expected,
(f2 == expected) ? "(PASS)" : "(FAIL)");
}
int
main(void)
{
fdiv(1.1754941e-38f, 0.9999999f, 1.1754942e-38f);
}
More information about the Linuxppc-dev
mailing list