Re: [csswg-drafts] [css-values] mod(−0, +∞) and mod(+0, −∞) not handled correctly (#4723)

> modular arithmetic with this notation as used in mathematics only applies to integers

Fair enough, I had only seen it with integers, but I thought I could generalize it.

> cotpi(x) = cot(πx), the cotangent of π times the argument.

Oh I didn't know this notation. I see your point, but floating point numbers don't have a `1⁺` and a `1⁻`. So `cotpi(1)` could be either +∞ or −∞. See related #4101 about `tan()`. `tan(x + 180deg) = tan(x)` but in infinite cases we decided on `tan(-90deg) = −∞` and `tan(90deg) = +∞`.

> I can’t think of any practical computation where a person would ever end up with `mod(x, ∞)`

Sure, I don't think people will use an explicit ∞, but possibly they will use some calculation which may end up being ∞ in certain cases.

> I think it would be better to just let mod(x, ∞) = NaN regardless.

NaN is reasonable for negative x, but not that sure about positive x. Intuitively I would expect `x`, though I could live with NaN.



-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4723#issuecomment-584095969 using your GitHub account

Received on Monday, 10 February 2020 12:18:45 UTC