[Python-ideas] float('∞')=float('inf')
Chris Angelico
rosuav at gmail.com
Fri Jul 12 18:28:39 CEST 2013
On Sat, Jul 13, 2013 at 2:08 AM, Chris “Kwpolska” Warrick
<kwpolska at gmail.com> wrote:
> On Fri, Jul 12, 2013 at 5:51 PM, Chris Angelico <rosuav at gmail.com> wrote:
>> ... it's fairly obvious that "3½" should be
>> accepted, but what does "½3" mean? I'm -0 on it initially, but would
>> change that to +0 if a suitable answer is found for that (even if it's
>> "raise ValueError, same as float('1.1.1') does") that doesn't make the
>> code horrendous.
>
> Umm, last time I checked, ³*½ = 1.5.
Not sure what you mean here. Yes, 3 times one half equals one and one
half, but the abuttal of "3½" meant 3.5 - at least, it did in my
school days. If float("½") == 0.5, then float("3½") should be 3.5.
Anything else would be treating it as an expression, not a
floating-point value.
ChrisA
More information about the Python-ideas
mailing list