Improve the numpy+floatX cast policy
Typical example of the current issues with cast_policy == numpy+floatX: when floatX is float64, an integer scalar will upcast a float32 array to float64, e.g. if one does 'array* 2'.
Suggested fix:
Given the three ordered broad type categories 'integer' (int* uint*) < 'float' (float*) < 'complex' (complex*), a scalar cannot upcast an array unless it is of a strictly higher category than the array.
Suggested fix:
Given the three ordered broad type categories 'integer' (int* uint*) < 'float' (float*) < 'complex' (complex*), a scalar cannot upcast an array unless it is of a strictly higher category than the array.
Leave a comment