Skip to content

[BUG] np.mod with output outside the divisor range #94

@juntyr

Description

@juntyr
np.mod(np.cosh(QuadPrecision("-11357.216553474703894801348310092223")), QuadPrecision("-1.7976931345860068e+308"))

# prints QuadPrecision('1.145669756344548161919429759370211e+4898', backend='sleef')

np.mod should return a result with the same sign as the divisor, her negative, and it should be in range of the absolute value of the divisor.

The issue likely comes from rounding errors in

Sleef_quad quotient = Sleef_divq1_u05(*a, *b);
Sleef_quad floored = Sleef_floorq1(quotient);
Sleef_quad product = Sleef_mulq1_u05(floored, *b);
Sleef_quad result = Sleef_subq1_u05(*a, product);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions