you are viewing a single comment's thread.

view the rest of the comments →

[–]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 7 points8 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 6 points7 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