Skip to content

cannot coerce real numbers to Integer #835

@sagetrac-dmharvey

Description

@sagetrac-dmharvey

If a real number is exactly an integer, it should be possible to coerce to an Integer, but this is what happens:

sage: Integer(RR(2.0))
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call last)

/Users/david/sage-2.8.5/<ipython console> in <module>()

/Users/david/sage-2.8.5/integer.pyx in integer.Integer.__init__()

<type 'exceptions.TypeError'>: unable to coerce element to an integer

Component: basic arithmetic

Issue created by migration from https://trac.sagemath.org/ticket/835

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions