Skip to content

Trig functions stringify then unstringify their inputs #2198

Open
@adroitwhiz

Description

@adroitwhiz

Expected Behavior

The words "string" and "trigonometric function" should not be anywhere near each other

Actual Behavior

The current implementations of the sin, cos, and tan functions (but not the asin, acos, and atan functions) stringify inputs to 10 decimal digits then un-stringify them.

This was introduced in #422 so that values which should be 0 but aren't due to rounding error (e.g. sin(180)) are rounded to 0. There's likely a much faster way to do this, though (see this benchmark).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions