Convert rational to fixed-point decimal number

Pisminskaya Alexandra Aleksandra.Pisminskaya at bercut.com
Tue Feb 16 14:10:32 CET 2010


Example, 0.3333333333333. Depend by my precision.

С уважением, Письминская Александра
-----Original Message-----
From: tg at gmplib.org [mailto:tg at gmplib.org] 
Sent: Tuesday, February 16, 2010 4:01 PM
To: Pisminskaya Alexandra
Cc: gmp-discuss at gmplib.org
Subject: Re: Convert rational to fixed-point decimal number

"Pisminskaya Alexandra" <Aleksandra.Pisminskaya at bercut.com> writes:

  I try to use mpq_ functions in my program. How can I convert mpq_t type
  to fixed-point decimal number without loss precision (without using
  double IEEE)?
  
I am not sure what function you need.

Assume you have 1/3.  What fixed-point decimal number do you want
returned?

-- 
Torbjörn


More information about the gmp-discuss mailing list