[cairo] rewriting libpixman

Jeff Muizelaar jeff at infidigm.net
Wed Apr 4 08:08:14 PDT 2007


On Wed, Apr 04, 2007 at 01:31:10AM -0400, James Cloos wrote:
> >>>>> "Jeff" == Jeff Muizelaar <jeff at infidigm.net> writes:
> 
> Jeff> I still don't follow this logic, specifically the last sentence.
> 
> Then I didn't explain it well enough....
> 
> I was actually investigating conversions between floats in [0.0,1.0]
> to and from ints in [0,2ⁿ), for any n ∈ ℤ⁺.
> 
> In that case, if you mupliply the float by 2ⁿ (saturating at 2ⁿ-1 if
> the float was ≥ 1.0) you get sane results.

Why are the results saner then multiplying by 2ⁿ-1? Also, you never
explained how this example fits into your theory:

Why should we prefer:

28*256/31 = 231.225806451

instead of

28*255/31 = 230.322580645

when:

28/31 = .903225806
and
231/255 = .905882352
230/255 = .901960784

-Jeff


More information about the cairo mailing list