Re: GMP Problem with % under C++

2020-11-05 Thread Marco Bodrato
Ciao, Il 2020-11-05 22:27 Niels Möller ha scritto: I think this is the same result you get with a plain (64-bit) long. The / and % operators in C++ produce a quotient rounded towards 0, so (f(1) - b) / DECKSIZE == 0, and the corresponding remainder is negative. I'm not that familiar with

Re: GMP Problem with % under C++

2020-11-05 Thread Niels Möller
Miki Hermann writes: > The result of the command '22b-gmp < 22input.txt' is: > >*** b = 62010736820046 >f(1) - b = -15681174147849 >a = -15681174147849 >On position 2020 is the card 102220661749926 I think this is the same result you get with a plain (64-bit) long. The / and %

Re: GMP Problem with % under C++

2020-11-05 Thread Marc Glisse
On Thu, 5 Nov 2020, Miki Hermann wrote: I am not sure if I used the GMP package properly or if I did everything right, but it seems to me that very probably there is a problem somewhere in the GMP package and/or its interface with C++. It is very probable that you are not familiar with the %

GMP Problem with % under C++

2020-11-05 Thread Miki Hermann
Dear Sirs. I have installed and started to use the GMP library. I wanted to use it on Part B of the problem presented in Advent of Code 2019 on Day 22. Previously, I was able to solve that problem only in Perl, using the bigint library. I am using Fedora 33. I downloaded and installed the GMP