[Python-ideas] Suggestion: Extend integers to include iNaN

Steve Barnes gadgetsteve at live.co.uk
Sun Sep 30 12:21:08 EDT 2018



On 30/09/2018 16:36, David Mertz wrote:
> On Sun, Sep 30, 2018 at 11:31 AM Steve Barnes <gadgetsteve at live.co.uk 
> <mailto:gadgetsteve at live.co.uk>> wrote:
> 
>     No complex can be converted to float without accessing either the real
>     or imag component.
> 
> 
> Sure. Not in Python 3.7.  But mathematically, it seems really 
> straightforward to say that Complex numbers that lie on the Real line 
> (i.e. imaginary part is zero) map in an obvious way to Real numbers.
> 
> I haven't done an inventory, but I'd guess most—but not all—other PLs do 
> the same thing Python does.
> 
Personally I agree that float(2.0+0j) should possibly be a valid value 
(2.0) but there is the complication, as always, of how near zero is 
zero. But that is a battle for another time.

-- 
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com



More information about the Python-ideas mailing list