julia
17dddc01 - promote_op() improvements

Commit
9 years ago
promote_op() improvements Use common promote_op() based on one() for all Number types: this fixes promote_op(+, ::Bool), which returned Int, and promote_op(==, ::Complex, ::Complex), which returned Complex{Bool}. Add fallback definitions returning Any so that broadcast() computes the appropriate return type, instead of using promote_type() which is often wrong. This fixes broadcast() when the return type is different from the input type. Add systematic tests for operators and their return types.
Author
Committer
Parents
Loading