On Mon, 25 Aug 2008 05:04:16 am Antoine Pitrou wrote: > > > CompareFloatsIntegers: 274ms 274ms 0.30us > > > 0.630ms > > > > Much slower, but probably due to switch from int -> long. There > > could be potential for optimizing this case. > > Well honestly you don't often compare different types. I think the > most common exception to this rule would be None vs. non-None. Surely the most common None vs non-None comparison would be the "is" operator, which I hope remains fast. I don't know about other people, but I often compare floats with ints. Here's a contrived example: x = some_float() if x == -1: return -2 else: return (x**2-1)/(x+1) I suppose it's no hardship to start writing float literals instead of int literals, if needed. -- Steven
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