Thanks to @longemen3000 and @giordano for the pointers to the discussions.
To be clear, I’m not personally after some abstract notion of complex irrationals, which I’ve never given any thought to. I was looking for a way to convert to a complex representation built from whatever real type the caller sends. And yes, it’s easy for me to actually do.
My point is the same one made by @giordano on 28 July 2017 in the thread he gave: “I’d say that it’s better to automatically convert complex(pi) to Complex{Float64} (first version of this PR) rather than throwing an error for a simple conversion.”
Justifications of current behavior based on preserving the abstraction of pi
to irrationality or arbitrary precision then have to explain why Complex(pi,0)
and pi/2
not only work but produce results based on Float64
(which is what the majority of scientific computation expects).
The treatment of pi
as a special kind of value is only a mm deep. Indeed, methodswith(typeof(pi))
returns no results in base. Irrational pi should be the use case that you go out of your way to find, as opposed to the current situation of the tail wagging the dog. I’d even go so far as to say it ought to be an explicit import.