-1

I am trying to decide which to use with the modular inverse function of GMP, and I can't seem does find the difference between mpq_t and mpf_t. The GMP manual mentions

— Function: void mpz_set_q (mpz_t rop, const mpq_t op)

— Function: void mpz_set_f (mpz_t rop, const mpf_t op)

when it talks about initializing them. Could anyone shed some light on this? Does the mpf_t maybe deal with floats? (and if so, what does mpq_t deal with?)

user2059300
  • 361
  • 1
  • 5
  • 17

1 Answers1

0

mpf_t is GMP's floating point type. mpq_t is GMP's rational type.

The documentation is here...

http://gmplib.org/manual/Nomenclature-and-Types.html#Nomenclature-and-Types

casevh
  • 11,093
  • 1
  • 24
  • 35
  • Rational numbers are stored in objects of type mpq_t. GMP floating point numbers are stored in objects of type mpf_t Thanks! – user2059300 Oct 06 '13 at 04:08