tmh
February 6th, 2005, 04:18
Here is error I found in the Sun JDK1.4.2 port on FreeBSD. This applies to patchset 6, it has been fixed in patchset 7. The following funcion:

java.lang.Math.pow(double a, double b)

is supposed to calculate (a) raised to the power (b) (a^b). If (a) is negative and (b) is odd, the result of the function should be negative. Due to a ones complement error that is introduced with the FreeBSD patchset 6 in the native C code (e_pow.c), this function returns a postive number for a negative (a) and odd (b). The best fix is to apply patchset 7. If you are unable to apply patchset 7, post a reply and I'll get you the fix. It is a one-liner, literally. But it is a pain to fix by hand, so use patchset 7.

Cheers,

Tom H.