Changes between Version 24 and Version 25 of Ticket #13110


Ignore:
Timestamp:
10/16/14 17:44:14 (7 years ago)
Author:
jdemeyer
Comment:

Sorry, I shouldn't have taken over this ticket, it's about something else.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13110

    • Property Component changed from coercion to numerical
    • Property Summary changed from Allow coercion complex -> CC to Deprecate global RealNumber() and ComplexNumber()
  • Ticket #13110 – Description

    v24 v25  
    1 This works fine:
     1The `RealNumber()` and `ComplexNumber()` are meant for the Sage preparser and shouldn't be used directly. For example, the following doesn't work:
    22{{{
    3 sage: CC(complex('13.8+6.2j'))
    4 13.8000000000000 + 6.20000000000000*I
    5 sage: CDF(complex('13.8+6.2j'))
    6 13.8 + 6.2*I
     3sage: ComplexNumber(complex('13.8+6.2j'))
     4TypeError: unable to coerce to a ComplexNumber: <type 'str'>
    75}}}
    8 
    9 However, it is a ''conversion'' while it should be a ''coercion''.
    10 {{{
    11 sage: CC.has_coerce_map_from(complex)
    12 False
    13 }}}
    14 This is inconsistent with
    15 {{{
    16 sage: CC.has_coerce_map_from(float)
    17 True
    18 }}}