W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Modulus operator & division by values

From: MaŽl Nison <nison.mael@gmail.com>
Date: Fri, 21 Jun 2013 12:18:22 +0200
Message-ID: <CANiF4iD=rrobrc1B5tZZ5YO3fBu368a1B+by9eC26ObA-Z-fig@mail.gmail.com>
To: www-style@w3.org

I've recently come across a use case where the modulus operator would have
been useful[1], so I was wondering what were the reason which led to its
eviction from the current spec. I have been able to find the following
discussion[2], but I'm not sure to fully understand the argument :

 1. We drop the 'mod' operator since it only makes sense when
    both operands have the same units.

In my fiddle, you can see that I'm using a 'px' modulus on a percentage,
and I think it makes perfect sense after converting the percent into a
pixel unit (which is probably delayed up to the rendering ?).

Am I missing something ?

[1] http://jsfiddle.net/bBESS/4/
[2] http://lists.w3.org/Archives/Public/www-style/2010Jul/0442.html

MaŽl Nison
Received on Saturday, 22 June 2013 12:12:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:31 UTC