Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83394 > unrolled thread

Re: Decimals and other numbers

Started byBen Finney <ben+python@benfinney.id.au>
First post2015-01-09 13:43 +1100
Last post2015-01-09 13:43 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Decimals and other numbers Ben Finney <ben+python@benfinney.id.au> - 2015-01-09 13:43 +1100

#83394 — Re: Decimals and other numbers

FromBen Finney <ben+python@benfinney.id.au>
Date2015-01-09 13:43 +1100
SubjectRe: Decimals and other numbers
Message-ID<mailman.17498.1420771428.18130.python-list@python.org>
Devin Jeanpierre <jeanpierreda@gmail.com> writes:

> decimal.InvalidOperation: 0 ** 0
>
> I'd file a bug report but I'm anticipating some rational (heh)
> explanation. Any ideas?

First note that it's explicitly documented as an invalid operation
<URL:file:///usr/share/doc/python3-doc/html/library/decimal.html#decimal.InvalidOperation>.
So someone has at least thought about it and deliberately decided it
should be so.

Why that should be, I don't know; I think the correct behaviour is for
‘0 ** 0 == 1’. But perhaps someone else has a better explanation for why
Decimal should behave differently from ‘int’ and ‘float’ here.

-- 
 \      “I bought a self learning record to learn Spanish. I turned it |
  `\        on and went to sleep; the record got stuck. The next day I |
_o__)                   could only stutter in Spanish.” —Steven Wright |
Ben Finney

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web