Skip to content

Handle floating points, which become imprecise past a certain threshold #12

@josueJURE

Description

@josueJURE
  • function safeIntegerMultiply(x, y) {
    if (!Number.isSafeInteger(x * y)) {
    throw new Error('Product is an unsafe integer');
    }
    return x * y;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions