Re: mpz_set_si loses long long value on Windows

2019-07-24 Thread Torbjörn Granlund
Vincent Lefevre writes: On 2019-07-24 11:29:42 +0200, Torbjorn Granlund wrote: > The problem with MPFR's approach is that the library API depends on the > compiler. Yes, but note that this is also the case with GMP, for the formatted output functions. :) Yikes! I wasn't aware of

Re: mpz_set_si loses long long value on Windows

2019-07-24 Thread Vincent Lefevre
On 2019-07-24 11:29:42 +0200, Torbjorn Granlund wrote: > The problem with MPFR's approach is that the library API depends on the > compiler. Yes, but note that this is also the case with GMP, for the formatted output functions. :) > (We could solve that issue by rejecting pre-C99 compilers. GMP

Re: mpz_set_si loses long long value on Windows

2019-07-24 Thread Torbjörn Granlund
Vincent Lefevre writes: GNU MPFR has mpfr_set_sj and mpfr_set_uj (when intmax_t is available) in addition to mpfr_set_si and mpfr_set_ui. Perhaps it could be nice for GMP to also have mpz_set_sj and mpz_set_uj in addition to mpz_set_si and mpz_set_ui. I have a probably incomplete patch

Re: mpz_set_si loses long long value on Windows

2019-07-24 Thread Vincent Lefevre
On 2019-07-24 11:11:46 +0200, Torbjorn Granlund wrote: > Dim XY writes: > This 'signed long int' type has different sizes of linux (8 bytes) and > windows 64bit (4 bytes) platforms > (https://en.cppreference.com/w/cpp/language/types) > > Maybe it is better to use 'long long' type which