I cannot seem to get reasonable results from a couple of floating
point library functions and wonder what I am doing wrong. I am
running on a 7260 and get the same results whether I use the cross
compiler or compile natively.
Test program:
$ cat test.c
#include<stdio.h>
int main(int argc, char **argv)
{
double test = 432.123;
double testTrunc = trunc(test);
double testFloor = floor(test);
double testCeil = ceil(test);
fprintf (stderr, "test start: %.3f, test trunc: %.3f, test floor:
%.3f, test ceil: %.3f\n",
test, testTrunc, testFloor, testCeil);
exit(0);
}
$ gcc -o test test.c -lm
$ ./test
test start: 432.123, test trunc: 1081803255.000, test floor: 4095.000,
test ceil: 4095.000
gcc -v
Reading specs from /usr/lib/gcc-lib/arm-linux/3.3.5/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--enable-__cxa_atexit --with-system-zlib --enable-nls
--without-included-gettext --enable-clocale=gnu --enable-debug
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc arm-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
Should this work?
Regards,
jw
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|