On Sat, Feb 17, 2001 at 05:49:58PM +0000, Nicholas Clark wrote:
> On Sat, Feb 17, 2001 at 05:36:03PM +0000, Russell King - ARM Linux wrote:
> > Peter Naulls writes:
> > > I tried out a Java benchmark, to test speed of FP - with this benchmark,
> > > it appears to be nearly twice as fast, which is fairly impressive.
> > > 
> > > Unfortunately, the benchmark uses exp() to calculate the final result,
> > > which makes it result wrong, as it appears to be misbehaving:
> > 
> > Under AcornFPE with the old a.out stuff:
> > 
> > 54.598150
> > 148.413159
> > 403.428793
> > 
> > NWFPE doesn't implement exp(), so the bug must be in glibc.
> 
> "Is that your final answer?" Perl is using doubles, so it may be glibc on
> single precision floating point only:
> 
> $ perl -le 'print exp(4)'
> 54.5981500331442
> $ uname -a
> Linux Bagpuss.unfortu.net 2.4.0-rmk3 #3 Sat Jan 20 21:38:55 GMT 2001 armv4l unknown
> $ dmesg | grep Rebel
> NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com

Hmm. Read the entire message twice before replying

gcc -Wall fpet.c -lm
fpet.c: In function `main':
fpet.c:3: warning: implicit declaration of function `printf'
fpet.c:3: warning: implicit declaration of function `exp'
fpet.c:3: warning: double format, different type arg (arg 2)
fpet.c:4: warning: double format, different type arg (arg 2)
fpet.c:5: warning: double format, different type arg (arg 2)
fpet.c:6: warning: control reaches end of non-void function
nick@Bagpuss [test]$ ./a.out 
0.000000
0.000000
0.000000

Adding #include <math.h>

gcc -Wall fpet.c -lm
fpet.c: In function `main':
fpet.c:3: warning: implicit declaration of function `printf'
fpet.c:6: warning: control reaches end of non-void function
nick@Bagpuss [test]$ ./a.out 
54.598150
148.413159
403.428793

[both Rebel.com gcc, and Debian's 2.95.2]

Is -Wall the final answer?

Nicholas Clark

_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to