Skip to content

Math.abs(-0) should be 0 #4

Open

Description

@deian

Hi all, Great stuff. I think there is a bug in Math.abs:

Math.abs = function (x) {
x = @ToNumber(x);
if (x < 0)
return -x;
else
return x;
};

According to the spec, abs of -0 should be 0 not 0.

Activity

  1. changed the title [-]Math.abs(-0) should be -0[/-] [+]Math.abs(-0) should be 0[/+] on Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions