Changes between Version 2 and Version 8 of Ticket #18076


Ignore:
Timestamp:
Mar 30, 2015, 4:26:33 PM (7 years ago)
Author:
Vincent Delecroix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18076

    • Property Commit changed from f739d53004dd326ef6412dc4f0ec283e59970586 to 1d2148e8a0eb2dbfd3575f209ced87626e84c6b1
    • Property Status changed from new to needs_review
  • Ticket #18076 – Description

    v2 v8  
    88- #17865: get rid of _native_coercion_ranks_inv and _native_coercion_ranks
    99
    10 We solve them all by defining coercions of numpy integers to `ZZ`, numpy floating to `RDF` and numpy complex floating to `CDF`. Also, coercion between numerical types (in `sage.structure.coerce`) are now done directly via the addition.
     10We solve them all by defining coercions of numpy integers to `ZZ`, numpy floating to `RDF` and numpy complex floating to `CDF`. Also, coercion between numerical types (in `sage.structure.coerce`) are now done directly via the addition. In particular, all of this used to fail
     11{{{
     12sage: import numpy
     13
     14sage: f(t) = t^2
     15sage: f(numpy.int32('1'))
     161
     17
     18sage: sin(numpy.int32(10))
     19sin(10)
     20
     21sage: 123 == numpy.int32(123)
     22True
     23
     24sage: 1j + numpy.float(2)
     252.00000000000000 + 1.00000000000000*I
     26sage: parent(_)
     27Complex Field with 53 bits of precision
     28
     29sage: RIF(1) <= numpy.float64(2.0)
     30True
     31}}}
    1132
    1233Some of them depend on modifying some internal in numpy and will not be solved here: