Does -0.5 fit an unsigned when truncated to an integer?

Torbjorn Granlund tg at gmplib.org
Mon Mar 18 22:35:51 CET 2013


bodrato at mail.dm.unipi.it writes:

  Il Lun, 18 Marzo 2013 12:05 pm, Torbjorn Granlund ha scritto:
  > Zimmermann Paul <Paul.Zimmermann at inria.fr> writes:
  >
  >   indeed this is inconsistent. mpf_fits_uint_p(-0.5) should return true,
  > as well
  >   as mpf_fits_uint_p(-0.99999999999).
  >
  > I am not so sure that would be the right fix here.
  
  Do you suggest to change the documentation so that it describes the
  current code?

I haven't though a lot about this, but it is not clear that -1 + eps
should be considered to fit an unsigned type.

-- 
Torbjörn


More information about the gmp-devel mailing list