Hi, On Tue, Oct 25, 2011 at 12:01 PM, Derek Homeier <derek@astro.physik.uni-goettingen.de> wrote:
On 25 Oct 2011, at 20:05, Matthew Brett wrote:
Both the same as numpy:
[mb312@jerry ~]$ gcc test.c test.c: In function 'main': test.c:5: warning: incompatible implicit declaration of built-in function 'powl'
I think implicit here means that that the arguments and the return values are treated as integers. Did you #include <math.h>?
Ah - you've detected my severe ignorance of c. But with math.h, the result is the same,
#include <stdio.h> #include <math.h>
int main(int argc, char* argv) { long double x; x = pow(2, 64); x -= 1; printf("%g %Lg\n", (double)x, x); }
What system/compiler is this? I am getting ./ldouble 1.84467e+19 1.84467e+19
and
res = np.longdouble(2)**64 res 18446744073709551616.0 2**64 18446744073709551616L res-1 18446744073709551615.0 np.__version__ '1.6.1'
as well as with
np.__version__ '2.0.0.dev-3d06f02' [yes, not very up to date]
and for all gcc versions /usr/bin/gcc -v Using built-in specs. Target: powerpc-apple-darwin9 Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --program-prefix= --host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9 Thread model: posix gcc version 4.0.1 (Apple Inc. build 5493)
to
/sw/bin/gcc-fsf-4.6 -v Using built-in specs. COLLECT_GCC=/sw/bin/gcc-fsf-4.6 COLLECT_LTO_WRAPPER=/sw/lib/gcc4.6/libexec/gcc/powerpc-apple-darwin9.8.0/4.6.1/lto-wrapper Target: powerpc-apple-darwin9.8.0 Configured with: ../gcc-4.6.1/configure --prefix=/sw --prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.6/info --enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6 --enable-cloog-backend=isl --disable-libjava-multilib --disable-libquadmath Thread model: posix gcc version 4.6.1 (GCC)
uname -a Darwin osiris.astro.physik.uni-goettingen.de 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh
mb312@jerry ~]$ gcc -v Using built-in specs. Target: powerpc-apple-darwin8 Configured with: /var/tmp/gcc/gcc-5370~2/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8 Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5370) [mb312@jerry ~]$ uname -a Darwin jerry.bic.berkeley.edu 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc Best, Matthew