[cairo] _cairo_color_compute_shorts fails with FPU set to single precision

Behdad Esfahbod behdad at behdad.org
Wed Aug 30 08:35:23 PDT 2006


On Wed, 2006-08-30 at 10:56 -0400, James Cloos wrote:
> >>>>> "Keith" == Keith Packard <keithp at keithp.com> writes:
> 
> Keith> Or i -= (i >> 16), which avoids the question of a branch.
> 
> What about when the float is > 1.0?

The float value in question is already clamped to [0.0,1.0].

> Shouldn't cairo explicitly support hdr whenever it is using floats?
> 
> And, incidently, does C guarantee that (uint32_t) some_float_or_double
> will be 0 if some_float_or_double is negative?  I suspect so, but don't
> have any books at hand....

No, I don't think it guarantees or results in 0.  I use a signed int for
almost that reason as I don't trust a floating point 0 :-).

> -JimC
-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list