On Fri, 19 Mar 2010 05:27:06 am Glenn Linderman wrote: > > Do you envisage any problems from allowing this instead? > > > >>>> Decimal('1.1')< 2.2 > > > > True > > Yes. > > As any non-naïve float user is aware, the proper form of float > comparisons is not to use < or > or == or !=, but rather, instead of > using < (to follow along with your example), one should use: > > Decimal('1.1') - 2.2 < epsilon
And yet we allow 1.1 < 2.2 instead of forcing users to do the "proper form". One can only wonder why the various standards (actual and de-facto) for floating point allows comparisons at all. But they do, and so does Python, and frankly even if the only reason is to satisfy lazy coders who don't have a requirement for high accuracy, then that's a good reason in my book, and one equally applicable to Decimal and float. -- Steven D'Aprano _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com