id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5525,Mismatch between documentation and behaviour of encodeFloat,daniel.is.fischer,,"In the process of elaborating the docs to treat #3898, I wrote
{{{
    -- | 'encodeFloat' performs the inverse of 'decodeFloat' in the
    -- sense that for finite @x@ with the exception of @-0.0@,
    -- @'uncurry' 'encodeFloat' ('decodeFloat' x) = x@.
    -- @'encodeFloat' m n@ is the closest representable floating-point
    -- number to @m*b^^n@ (or @&#177;Infinity@ if overflow occurs).
}}}
Unfortunately, the last sentence is not quite true. If the end result is a subnormal number, `encodeFloat` performs two roundings, which may lead to a wrong result (can be 1 ulp off). Changing `encodeFloat` so that it always finds the closest representable number would cost a lot in performance, it would bring it close to `fromRational`. So the thing to do is change the docs, I just don't know how yet.",bug,closed,normal,,libraries/base,7.3,fixed,,,Unknown/Multiple,Unknown/Multiple,Documentation bug,,,,,
