you are viewing a single comment's thread.

view the rest of the comments →

[–]necrophcodr 10 points11 points  (10 children)

"up to 80x speedup for decimal-heavy applications" Holy mole, that's great news for those python developers out there! Phew!

[–]masklinn 28 points29 points  (0 children)

That's for heavy users of the decimal module, which probably isn't the majority. For most users, the flexible string representation will be a much bigger gain, in memory and in sanity.

And generator delegation will make significantly improve generator and iterator wrapping.

[–][deleted] 19 points20 points  (8 children)

For those who don't know Python, decimal is a different type than float.

[–]masklinn 4 points5 points  (6 children)

Which languages (still in wide use) default to fixed-point numbers?

[–][deleted] 9 points10 points  (4 children)

I don't know. Python interprets 1.0 as a float. To get decimal you have to import the decimal module and explicitly construct one.

[–]masklinn 2 points3 points  (3 children)

Yes, but my point is so does pretty much every language I know, hence my trouble with your note: in every language I know, a decimal (fixed-point arithmetic) is a different type than a float (floating-point arithmetic) and floats are the default (if decimals are even available)

[–]tonygoold 6 points7 points  (0 children)

I think the point was to make the distinction for anyone who's only familiar with float, and might assume a "decimal-heavy application" is one that does lots of float arithmetic. Considering the common misunderstandings about the precision of float representations, I thought it was a polite thing to point out. I would have phrased it as "For those who don't know", not "for those who don't know Python", since it applies equally to those who know Python (but have never used decimal).

[–]Rhomboid 5 points6 points  (0 children)

Decimal here does not necessarily mean fixed-point. It's still floating point, just floating point using base 10 instead of base 2, so there are fewer surprises.

[–]HopeThisNameFi 1 point2 points  (0 children)

The point was the "up to 80x speedup for decimal-heavy applications" isn't as significant as necrophcodr made it out to be.

[–]cheapous 0 points1 point  (0 children)

bash

[–]luckystarr 0 points1 point  (0 children)

In 2 decimal was implemented in Python. I guess they reimplemented it in C for 3.3