12.4.10 Exchanging GMP numbers
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Exchanging GMP numbers
            • PL_get_mpz()
            • PL_get_mpq()
            • PL_unify_mpz()
            • PL_unify_mpq()
    • Packages
Availability:C-language interface function
int PL_get_mpq(term_t t, mpq_t mpq)
If t is an integer or rational number (term rdiv/2), mpq is filled with the normalised rational number and the function returns TRUE. Otherwise mpq is untouched and the function returns FALSE. Note that mpq must have been initialised before calling this function and must be cleared using mpq_clear() to reclaim any storage associated with it.