-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UniformScaling: allow writing generic polynomicals with I. #6472
Conversation
StefanKarpinski
commented
Apr 8, 2014
julia> p(x) = x^2 - 2x + I p (generic function with 1 method) julia> p(4) 9 julia> p(rand(3,3)) 3x3 Array{Float64,2}: 0.386215 -0.22931 0.0859286 -0.18856 0.664356 -0.693054 0.0600554 -0.361883 0.619314
cc: @JeffBezanson, @andreasnoackjensen, @jiahao, @stevengj, @ViralBShah |
No objections here. |
UniformScaling: allow writing generic polynomicals with I.
+1 for UniformScaling + Number = Number, which I take it is the heart of this. (LGTM) |
Yep, that was the change. It's an interesting case because how you "promote" is different for different for different arithmetic operations. |
👍 |
Also cute: julia> p(I)
UniformScaling{Int64}(0) |
That is cute. |
It's also a nice sign of consistency. Thanks for bringing it up! |
Looks like the scope of this type could (should?) be extended to any ring, becoming part of the (informally defined) interface provided by |
(Update: I just added |