Mark Dickinson <dickinsm <at> gmail.com> writes: > > On Fri, Mar 19, 2010 at 9:50 PM, Guido van Rossum <guido <at> python.org> wrote: > > There is one choice which I'm not sure about. Should a mixed > > float/Decimal operation return a float or a Decimal? > > I'll just say that it's much easier to return a Decimal if you want to > be able to make guarantees about rounding behaviour, basically because > floats can be converted losslessly to Decimals. I also like the fact > that the decimal module offers more control (rounding mode, precision, > flags, wider exponent range) than float. A problem, though, is that decimals are much slower than floats. If you have a decimal creeping in some part of a calculation it could degrade performance quite a bit. Regards Antoine.
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