Skip to content

Improve as_relational for Integers and Naturals #21285

Open
@Sagar231

Description

Integers.as_relational(x) gives the following output:

>>> Integers.as_relational(x)  # and similar for Naturals and Naturals0
(-oo < x) & (x < oo) & Eq(floor(x), x) 

But it should be:

>>> Integers.as_relational(x)  # and similar for Naturals and Naturals0
(-oo < x) & (x < oo) & Eq(Mod(x, 1), 0)

Same for the Naturals.
Because floor is defined on complex numbers and the relationals required input to be real.

Originally posted by @smichr in #21259 (comment)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions