Skip to content

SleefQuadPrecision np.mod ufunc gives unexpected results #35

@juntyr

Description

@juntyr

The numpy docs state about np.mod that

It is equivalent to the Python modulus operator x1 % x2 and has the same sign as the divisor x2

For [-1.1, -1.0, -0.9, -0.1, 0.0, 0.1, 0.9, 1.0, 1.1], float64 mod +1 gives [0.9, 0.0, 0.1, 0.9, 0.0, 0.1, 0.9, 0.0, 0.1] and mod -1 [-0.1, -0.0, -0.9, -0.1, -0.0, -0.9, -0.1, -0.0, -0.9], but sleef gives [-0.1, -0.0, -0.9, -0.1, 0.0, 0.1, 0.9, 0.1] for both mod +1 and mod -1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions