From: Pascal C. <pi...@gm...> - 2009-02-05 17:26:22
|
Hi everyone, I experienced some problems today, with overflows on floating point calculations, with rounding errors, or overflows in GDI rendering. The W3 specification says: It is recommended that higher precision floating point storage and computation be performed on operations such as coordinate system transformations to provide the best possible precision and to prevent round-off errors. Conforming High-Quality SVG Viewers<http://www.w3.org/TR/SVG11/conform.html#ConformingHighQualitySVGViewers> are required to use at least double-precision floating point (see [ICC32<http://www.color.org/ICC-1A_1999-04.PDF>]) for intermediate calculations on certain numerical operations. Within the SVG DOM, a <number> is represented as a float or an SVGAnimatedNumber<http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedNumber> . so even if they speak about float in end, it's all left to user choice before. My suggestion is to: - use double in SVG DOM (it also has the effect of speeding up computations, since it's the native format) - use float in SVG renderer and let the renderer do the conversion by itself (and check the overflows there). Pascal. jabber/gtalk: pa...@ja... msn: pa...@cr... |