[MPlayer-dev-eng] lround?

Charles Henrich henrich at sigbus.com
Sun Jun 16 01:32:57 CEST 2002


On the subject of Re: Re: [MPlayer-dev-eng] lround?, Arpi stated:

> > Seems a simple replacement of this is to just add .5 to the value and
> > assign to an integer, why a function for it?
> 
> imho lround and +.5 behaves different with negative numbers and probably c
> compilers have optimized inline code/macro for it...  (afair there is such
> rounding&conversion instruction on x86, so it may be even faster than adding
> a constant and then converting to int)

Hmm, I hadnt thought about the negative number case.  I guess it depends on if
you want the rounding direction to depend on the case.  

-Crh

       Charles Henrich                                   henrich at msu.edu

                       http://www.sigbus.com:81/~henrich



More information about the MPlayer-dev-eng mailing list