[cairo] _cairo_color_compute_shorts fails with FPU set to single precision

Fabien Costantini fab672000 at yahoo.fr
Thu Aug 31 03:58:37 PDT 2006


----- Message d'origine ----
De : Bill Spitzak <spitzak at d2.com>

>Why not put the clamping and conversion into the same code? This would 
>if (f <= 0) x = 0; else if (f < 1) x = (int)(f*65535); else x = 65535;
I agree, but wouln't it be better to mult. by 65536 instead of 65536 as follow:
>if (f <= 0) x = 0; else if (f < 1) x = (int)(f*65536); else x = 65535;
because otherwise even values very near from 1.0 (like 1.0- 1.e-9) would be 65534.

Fabien




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20060831/f061d93b/attachment.html


More information about the cairo mailing list