Hi,

On Tue, Oct 25, 2011 at 10:52 AM, Charles R Harris
<charlesr.har...@gmail.com> wrote:
>
>
> On Tue, Oct 25, 2011 at 11:45 AM, Matthew Brett <matthew.br...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> On Tue, Oct 25, 2011 at 2:43 AM, Pauli Virtanen <p...@iki.fi> wrote:
>> > 25.10.2011 06:59, Matthew Brett kirjoitti:
>> >> res = np.longdouble(2)**64
>> >> res-1
>> >> 36893488147419103231.0
>> >
>> > Can you check if long double works properly (not a given) in C on that
>> > platform:
>> >
>> >        long double x;
>> >        x = powl(2, 64);
>> >        x -= 1;
>> >        printf("%g %Lg\n", (double)x, x);
>> >
>> > or, in case the platform doesn't have powl:
>> >
>> >        long double x;
>> >        x = pow(2, 64);
>> >        x -= 1;
>> >        printf("%g %Lg\n", (double)x, x);
>>
>> 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);
}

See you,

Matthew
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to