Looks like my new expf() and logf() broke the powf
regression test on mcs51 large model. But these work
fine when I test them with the same input as the
regression test uses.
Here is some shorter sample code that demonstrates the
problem. A Makefile is included which builds this
simple, single-file test case and runs it with ucsim.
Just type "make" to build the code and see its output
Tested with version: SDCC :
2.4.7 #920 (Jan 4 2005) (UNIX)
The output looks like this:
Correct output should be:
1.5^2 = 2.2500000
1.5^2 = 0x40100000
Actual output is:
1.5^2 = -39063.2421875
1.5^2 = 0xC718973E
If the unused code is removed (see comments), the
correct output is produced.
I'm still working on this, but it's very mysterious.
If anyone complains about the regression, I'll probably
switch the library back to the old C versions of logf
and expf (if that happens, edit #defines math.h and
rebuild sdcc). Hard to tell if this bug is in these
new functions or somewhere else.
Contact paul AT pjrc.com for more info.
Log in to post a comment.