W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: [css3-values] Definition of mod in calc()

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 10 Oct 2011 18:42:22 -0700
Message-ID: <CAAWBYDBnCgZekudA2mdoHQr=ONWMdYmTnUZqvNTasbgyeEAVhw@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style list <www-style@w3.org>
On Mon, Oct 10, 2011 at 6:39 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Monday 2011-10-10 18:21 -0700, Tab Atkins Jr. wrote:
>> There are two widely-used definitions of the modulus operator: one
>> that keeps negative numbers negative, and one that makes them
>> positive.  As an example, the expression "-8 mod 5" evaluates to
>> either -3 or 2, depending on which definition you use.  To be safe,
>> some uses of modulus in pseudocode in our modules writes the math as
>> "((a mod b) + b) mod b)", which produces the latter answer regardless
>> of the definition you use.
>>
>> Which interpretation should the spec use?
>
> It should not have a 'mod' operator.  See:
> http://lists.w3.org/Archives/Public/www-style/2010Jul/0442.html
> http://lists.w3.org/Archives/Public/www-style/2010Aug/0138.html

Ah, indeed.  It was still hanging around in the draft, so we'll just
remove it completely now.

~TJ
Received on Tuesday, 11 October 2011 01:43:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT