mpz_set_si loses long long value on Windows

Vincent Lefevre vincent at vinc17.net
Wed Jul 24 09:20:50 UTC 2019


On 2019-07-24 11:11:46 +0200, Torbjorn Granlund wrote:
> Dim XY <dim0071 at gmail.com> 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 always has the size
>   of 8 bytes on any platform?
> 
> You're essentially lobbying for an incompatible change in GMP by
> making a spurious GMP bug report.

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.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list