On Wed, Jun 21, 2006, Nick Coghlan wrote: > Facundo Batista wrote: >> >> BTW, prove me Decimal is not fast enough, ;) > > C:\Python24>python -m timeit -s "x = 1.0" "x+x" > 10000000 loops, best of 3: 0.137 usec per loop > > C:\Python24>python -m timeit -s "from decimal import Decimal as d; x = d(1)" "x+x" > 10000 loops, best of 3: 48.3 usec per loop > > I don't really know my definition of 'fast enough to be the basic > floating point type', but I'm pretty sure that a couple of orders of > magnitude slower isn't it. I guess I'll find out what my definition is > if the C implementation manages to get there ;) Why isn't that fast enough? Relative speed is *not* the issue when talking about real-world applications. More to the point, the expectation is that the C implementation of Decimal will have faster conversion to/from string, which in many real world applications forms a significant part of the processing load. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I saw `cout' being shifted "Hello world" times to the left and stopped right there." --Steve Gonedes
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