Skip to content

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

Description

@Loirooriol

From https://drafts.csswg.org/css-values-4/#round-infinities

In mod(A, B) only, if B is infinite and A is non-zero and has opposite sign to B, the result is NaN.
Note: All other "infinite B" cases are valid, and just return A immediately.

This means that mod(−0, +∞) = −0 and mod(+0, −∞) = +0.

However, the returned value is supposed to be between zero and B, with

if B is positive the range starts at 0⁺, and if B is negative it starts at 0⁻.

So we should have mod(−0, +∞) = +0 and mod(+0, −∞) = −0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions