W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

Re: [css3-transitions] Where does SMIL/SVG Animation define interpolation of integers?

From: Brian Birtles <bbirtles@mozilla.com>
Date: Tue, 05 Feb 2013 22:29:21 +1100
Message-ID: <5110ED11.6020405@mozilla.com>
To: public-fx@w3.org
(2013/02/05 17:17), L. David Baron wrote:
> The CSS WG resolved today to change the integer interpolation rules
> css3-transitions to match SMIL / SVG Animation and use round rather
> than floor.
>
> However, I'd like to know where in SMIL or SVG Animation the
> rounding rules for integers are defined so I know exactly what sort
> of rounding to define.  (In particular, whether *.5 values round
> away from zero, towards zero, towards positive infinity, or towards
> negative infinity.)  I searched some relevant specs, but couldn't
> find the definition.

Hi David,

Although SVG only references SMIL Animation, there are a number of areas 
there are more precisely defined in SMIL 3.0 and there is a general 
understanding that these more precise definitions should be backported 
to SVG.

As a result the integer rounding behaviour is defined in SMIL 3.0, 
section 17.4.13 under 'Integration definitions'[1].

The definition there is:

   coerced-integer-value = Math.floor( interpolated-value + 0.5 )

Best regards,

Brian

[1] 
http://www.w3.org/TR/SMIL/smil-profile.html#SMILProfileNS-animation-module
Received on Tuesday, 5 February 2013 11:29:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 5 February 2013 11:29:52 GMT