[FFmpeg-devel] [PATCH] eval: add bitor and bitand functions

Stefano Sabatini stefasab at gmail.com
Thu Mar 14 23:02:03 CET 2013


On date Thursday 2013-03-14 22:16:39 +0100, Reimar Döffinger encoded:
> On Thu, Mar 14, 2013 at 09:34:40PM +0100, Stefano Sabatini wrote:
> > On date Wednesday 2013-03-13 22:51:02 +0100, Michael Niedermayer encoded:
> > > On Wed, Mar 13, 2013 at 10:36:45PM +0100, Stefano Sabatini wrote:
[...]
> > > > + at item bitand(x, y)
> > > > + at item bitor(x, y)
> > > > +Compute bitwise and/or operation on @var{x} and @var{y}.
> > > > +
> > > > + at var{x} and @var{y} are converted to integers before executing the
> > > > +operation. Operation result is undefined if the integer representation
> > > > +of @var{x} or @var{y} takes more than 64 bits.
> > > 
> > > double precission floats do not have 64 bit mantissas so this will
> > > fail with many 64bit values
> > 
> > Updated with this commented removed. I assume the reader realizes
> > that the conversion is potentially lossy.
> 
> That is assuming a bit much I think, maybe it would be better to add
> something like:

> Note that both the conversion to integer and the conversion back to
> floating point can lose precision. Beware of unexpected results for large numbers
> (usually 2^53 and larger).

Works for me.

Any other comments or should I push the patch?
-- 
FFmpeg = Forgiving & Furious Mournful Proud Earthshaking Game


More information about the ffmpeg-devel mailing list