RE: Numerical Limits in SVG coordinates?

Interesting.   Good to know.  That single precision limitation would possibly limit the applicability of SVG for engineering diagram usage, where the need for rapid frame rendering is typically not of value, but range and precision are.


-----Original Message-----
From: Cameron McCormack [] 
Sent: Thursday, February 05, 2015 14:32
To: Smailus, Thomas O
Cc: Amelia Bellamy-Royds; Rik Cabanier; www-svg
Subject: Re: Numerical Limits in SVG coordinates?

Smailus, Thomas O:
> Which brings me back to my original question – should we put some 
> numerical precision guidance in the standard, that says something like 
> “conforming viewers implement floating point as at least 32 bit 
> precision in both mantissa and exponent, and integers with at least 32 
> bit precision” or maybe IEEE 754 64 bit precision or ‘something’
> so that SVG creators have an expectation to target?

We already have this section:

which is kind of hand wavey, but I would interprete to mean “attributes/properties must at least accept the full range of IEEE 754 single precision finite numbers, and calculations for rendering etc.
must also be done with single precision”.

This of course makes software based on Cairo compiled in fixed point mode non-conforming.

Requiring IEEE 754 double precision would definitely make Firefox non- conforming, and I don’t think we could easily change.  Our graphics library (that wraps Cairo, D2D, CoreGraphics etc.) uses single precision values, and I think that decision was made because single precision is used in GPU hardware, where more and more of the graphics processing is happening.

Cameron McCormack ≝

Received on Thursday, 19 February 2015 21:20:51 UTC