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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4