- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 688
 
Closed
Milestone
Description
The goal is to always return some float, either real or complex but:
sage: from sage.libs.pynac.pynac import py_float_for_doctests as py_float
sage: py_float(I, {'parent':RealField(10)})
...
TypeError: unable to convert '1.0*I' to a real number
The code shows it's only done if there is no parent given:
    if kwds is not NULL:
        return (<object>kwds)['parent'](n)
    else:
        try:
            return RR(n)
        except TypeError:
            return CC(n)
The ticket should make it possible to fall back on the associated complex field of any parent.
Depends on #23145
Component: interfaces
Author: Ralf Stephan
Branch/Commit: 856f8dd
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/23077