mpq_get_d_nearest

2013-04-12 Thread Zimmermann Paul
Hi, the mpq_get_d function rounds towards zero (i.e., truncates). In several applications, people usually prefer rounding to nearest. Is it planned to provide a function (say mpq_get_d_nearest) for that? I could contribute it, based on the code below (which does not deal with subnormal

Re: mpq_get_d_nearest

2013-04-12 Thread Marc Glisse
On Fri, 12 Apr 2013, Zimmermann Paul wrote: the mpq_get_d function rounds towards zero (i.e., truncates). In several applications, people usually prefer rounding to nearest. Is it planned to provide a function (say mpq_get_d_nearest) for that? I could contribute it, based on the code below

Re: mpq_get_d_nearest

2013-04-12 Thread Zimmermann Paul
to provide a function (say mpq_get_d_nearest) for that? I could contribute it, based on the code below (which does not deal with subnormal numbers yet). We could also have rounding towards -infinity and +infinity, which would be useful for people doing interval arithmetic. Preferably