That Linux Squeak 2.3 float error again
Lex Spoon
lex at cc.gatech.edu
Fri Feb 19 00:00:08 UTC 1999
"Richard L. Peskin" <rlpcon at vermontel.net> wrote:
> Has anyone verified the float error in Squeak 2.3 Linux, that is the
error:
> 0.0 raisedTo: 0.75 ==> NaN ?
>
> I am trying to see if it is my system or a primitive error.
>
> thanks,
> --dick peskin
>
On linux it seems to be the C library exp() which is at fault.
log(0.0) = -Inf
log(0.0)*0.75 = -Inf
exp(log(0.0)*0.75) = NaN
The test program is appended. In cas somebody else's linux box is
better, here's my computer's stats:
Linux 2.2.1
AMD K6-2/300Mhz
libc 5.4.23
libm 5.0.8
I tried this program on a Solaris box, by the way, and the last answer
was 0.
Lex
#include <math.h>
#include <stdio.h>
int main(void)
{
printf("log(0.0) = %f\n", log(0.0));
printf("log(0.0)*0.75 = %f\n", log(0.0) * 0.75);
printf("exp(log(0.0)*0.75) = %f\n", exp(log(0.0) * 0.75));
return 0;
}
More information about the Squeak-dev
mailing list
|