Bin Xin <spamtrap@[EMAIL PROTECTED]
> wrote:
>...
> It's working to some extent. For example the following code:
>>>>
> printf("%.3f\n", my_pow(2.0, 35.3));
>
> //... some other code
>
> printf("%.3f\n", my_pow(2.0, 35.3));
><<<
>outputs:
>
>42301799935.756
>2.000
>
>In other words, the first invocation get the right results, but not
>the second one. My intuition is that both log and pow are pure
>function, so this should not happen. But then again, I have limited
>experience in FP coding at assembly level, so there might be some
>thing I overlooked. Like maybe the special ways the FP registers or
>FP status register have to be manipulated.
I admit that I lost track part way through, but it looks to me like you
aren't cleaning up the floating point stack when you are done. If you
leave stuff on the stack, sooner or later the stack will overflow (there
are only 8 entries, after all), which triggers floating point exceptions.
--
Tim Roberts, timr@[EMAIL PROTECTED]
& Boekelheide, Inc.


|