Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #10823 > unrolled thread
| Started by | Dave Angel <davea@ieee.org> |
|---|---|
| First post | 2011-08-03 15:15 -0400 |
| Last post | 2011-08-03 15:15 -0400 |
| 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.
Re: Equality check Dave Angel <davea@ieee.org> - 2011-08-03 15:15 -0400
| From | Dave Angel <davea@ieee.org> |
|---|---|
| Date | 2011-08-03 15:15 -0400 |
| Subject | Re: Equality check |
| Message-ID | <mailman.1861.1312399277.1164.python-list@python.org> |
On 01/-10/-28163 02:59 PM, Abhishek Jain wrote:
> How to check equality of two nos. in python
>
Python doesn't have numbers, it has various numeric data types. If all
you're concerned with are int types, then just use the obvous:
if a == b:
dosomething....
If one or both might be floats, you have to deal with the likelihood
that one or both may have quantization error, either caused by
computational approximations, precision limitations, or conversion back
and forth between string and internal binary representation.
If one is in Decimal, you have to mostly deal with the first two.
If one is complex, ...
DaveA
Back to top | Article view | comp.lang.python
csiph-web