Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Petition to use Number namespace instead of Math #7

Description

@Rudxain

Why?

  • Math methods usually return numbers, signbit returns a Boolean
  • Math is more focused on proper mathematical operations, Number is more focused on implementation details (like the sign bit of an IEEE-754 float)
  • Number methods usually don't perform coercion, which may be useful for this proposal
  • It's more expected and consistent, it follows the "principle of least surprise"

One problem is handling non-numeric inputs, because it can't rely on coercion, so I suggest throwing an error, returning undefined instead of a bool, or switch to returning Numbers and return NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions