mini-gmp and mpq
bodrato at mail.dm.unipi.it
Mon Feb 19 15:08:49 UTC 2018
Il Mer, 14 Febbraio 2018 8:07 pm, Andreas Fabri ha scritto:
> In the CGAL project ( != Daniele Panozzos project) we combine
> double interval arithmetic with mpq when interval arithmetic
> fails (say a comparison of two overlapping intervals)
> in order to be fast and correct, and we would need:
Are you speaking about GMP or mini-gmp?
mini-gmp does not support mpq yet.
> 1) the construction of a mpq from a double
In GMP we already have mpq_set_d, doesn't it fit your needs?
> 2) the conversion of a mpq to its closest double
mpq_get_d currently gives a double, but rounded towards zero...
> 3) the conversion of a mpq to a tight double interval.
... that with the °next° double gives, more or less, what you want, don't it?
More information about the gmp-discuss