W3C home > Mailing lists > Public > www-style@w3.org > December 2018

[css-values] Rounding a real number to an integer

From: Gérard Talbot <www-style@gtalbot.org>
Date: Sat, 15 Dec 2018 19:46:36 -0500
To: W3C www-style mailing list <www-style@w3.org>
Message-ID: <94b82ebd5c8c28103b20fe2b11f7b758@gtalbot.org>
Hello,

"
(...) interpolation happens in the real number space as for <number>s, 
and the result is converted to an <integer> by rounding to the nearest 
integer, with *_values halfway between adjacent integers rounded towards 
positive infinity_*.
"
CSS4 Values, section 5.1.1. Combination of <integer>
https://www.w3.org/TR/css-values-4/#combine-integers

So

'z-index: -1.5'
should be converted to 'z-index: -1' and not to 'z-index: -2'
while
'z-index: 1.5'
should be converted to 'z-index: 2'.

Is my interpretation of the spec correct?

Gérard
Received on Sunday, 16 December 2018 00:47:05 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 16 December 2018 00:47:06 UTC