Skip to content

Support Math::BigInt/BigFloat in number comparisons #1047

@Arnatious

Description

@Arnatious

When used raw in is() comparisons, BigInts and Floats are deep compared as objects, which can cause issues if accuracy and precision are different. Attempting to use number fails since Math::BigInt and Float are hashrefs and therefore fail the following check:

return 0 if ref $got;

Adding support for these to number (e.g. checking if the ref isa() Math::BigInt) would be useful, or maybe as a separate checker that can also allow configuration of the other attributes.

(And there's always the bigint and bignum pragmas to make it work as is)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions