Arithmetic on big integers using libgmp