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


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

Re: Equality check

Started byDave Angel <davea@ieee.org>
First post2011-08-03 15:15 -0400
Last post2011-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.


Contents

  Re: Equality check Dave Angel <davea@ieee.org> - 2011-08-03 15:15 -0400

#10823 — Re: Equality check

FromDave Angel <davea@ieee.org>
Date2011-08-03 15:15 -0400
SubjectRe: 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

[toc] | [standalone]


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


csiph-web