- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Sat, 01 Feb 2020 00:23:08 +0000
- To: public-css-archive@w3.org
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-values] round(strategy, A, ±∞) ==
https://drafts.csswg.org/css-values-4/#round-infinities says
> In `round(A, B)` [...] If A is finite and B is infinite, the result is 0⁺ if A is 0⁺ or positive finite, and 0⁻ if A is 0⁻ or negative finite.
First, I assume `round(A, B)` actually means `round(strategy, A, B)`. Otherwise the spec should define what to for non-`nearest` strategies.
But then, consider `round(up, 1, ±∞) = +0`. IMO it doesn't make much sense that if we round 1 upwards, we get a smaller value! Analogous for `round(down, −1, ±∞) = −0`.
Also, returning 0 for an infinite precision seems to imply that 0 is a multiple of infinity. But `0 * ∞ = NaN`, not `0`. This makes me a bit uneasy, though I guess it's fine if you consider limits.
So I think there are 2 reasonable approaches:
- Say that `round(strategy, A, ±∞)` is always NaN.
- For `A` finite, say that `round(strategy, A, ±∞) = lim_{x→∞} round(strategy, A, x)`, i.e.
- `round(up, A, ±∞)` is `+∞` if `A > 0`, `−0` if `A < 0`, or `A` otherwise.
- `round(down, A, ±∞)` is `−∞` if `A < 0`, `+0` if `A > 0`, or `A` otherwise.
- `round(to-zero, A, ±∞)` is `−0` if `A < 0`, `+0` if `A > 0`, or `A` otherwise.
- `round(nearest, A, ±∞)` is `−0` if `A < 0`, `+0` if `A > 0`, or `A` otherwise.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4725 using your GitHub account
Received on Saturday, 1 February 2020 00:23:09 UTC