[Python-ideas] Suggestion: Extend integers to include iNaN
gadgetsteve at live.co.uk
Sun Sep 30 11:17:51 EDT 2018
On 30/09/2018 16:13, David Mertz wrote:
> On Sun, Sep 30, 2018 at 11:01 AM Steve Barnes <gadgetsteve at live.co.uk
> <mailto:gadgetsteve at live.co.uk>> wrote:
> Adding inf & -inf would be nice but to do so we would need a better
> than NaNAwareInt.
> My placeholder name is deliberately awkward. I think it gestures at the
> concept for discussion purposes though.
> It would also be nice if Decimal(NaNAwareInt('nan')) = Decimal('NaN'),
> float(NaNAwareInt('nan')) = float('nan'), etc.
> This seems like bad behavior given (per IEEE-754 spec):
> >>> float('nan') == float('nan')
> >>> nan = float('nan')
> >>> nan == nan
> Keeping medicines from the bloodstreams of the sick; food
> from the bellies of the hungry; books from the hands of the
> uneducated; technology from the underdeveloped; and putting
> advocates of freedom in prisons. Intellectual property is
> to the 21st century what the slave trade was to the 16th.
Note that my statements above had a single = i.e.
float(NaNAwareInt('nan')) produces float('nan'), etc., as does:
In : nan = decimal.Decimal('nan')
In : decimal.Decimal(nan)
In : float(nan)
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.
More information about the Python-ideas