Skip to content

Suggestion: More narrow type for Math.sign #19954

Closed
@kreba

Description

@kreba

The type for Math.sign is currently (x: number): number as seen in
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es6.d.ts#L4177

Its type could be (x: number): -1 | 0 | 1 instead.

That would allow for more specific typing in app code without having to wrap Math.sign.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions