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

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

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 18 Dec 2018 16:58:05 -0800
To: Gérard Talbot <www-style@gtalbot.org>, W3C www-style mailing list <www-style@w3.org>
Message-ID: <65fee1b0-8cdb-e067-86b5-c2591b59e095@inkedblade.net>
On 12/15/18 6:46 PM, Gérard Talbot wrote:
> Le 2018-12-15 19:46, Gérard Talbot a écrit :
>> 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'.
> 
> Oops.. I meant
> 
> 'z-index: calc(-1.5)'
> should compute to 'z-index: -1' and not to 'z-index: -2'
> while
> 'z-index: calc(1.5)'
> should compute to 'z-index: 2'.
> 
>>
>> Is my interpretation of the spec correct?

Afaict it is correct. If that's not what implementations do,
though, let us know as we may need to adjust the spec. :)

~fantasai
Received on Wednesday, 19 December 2018 00:58:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 19 December 2018 00:58:30 UTC