Coq < Compute 0.1.
Toplevel input, characters 8-11:
> Compute 0.1.
> ^^^
Warning: The constant 0.1 is not a binary64 floating-point value. A closest
value 0x1.999999999999ap-4 will be used and unambiguously printed
0.10000000000000001. [inexact-float,parsing]
= 0.10000000000000001
: float
See also: https://github.com/purerl/purerl, an Erlang backend for PureScript, which is a lot more mature but unfortunately doesn't get the attention it deserves.
While I can understand how that code can be intimidating to a programmer with a more “traditional” background… there are 26 (non-empty) lines of comments, and only 15 lines of code.
Quite surprising for me too. Or rather, I don't understand the unit they mention. From the article linked:
also collected alcoholic beverage consumption, including red and white wine separately (4 ounces, increasing to 5 ounces in 2006), beer (one glass, can, or bottle), and liquor (one drink or shot). We multiplied the amount of alcohol in grams per specified portion size by servings per day, determined the midpoint of the frequency category, and summed across all beverages to estimate the average alcohol consumption (g/day). We defined moderate alcohol consumption as 5-15 g/day for women and 5-30 g/day for men
Surely it cannot be 4 bottles of beer daily (or 4*7 bottles on weekend).
Assume the values could be equal if the relative error of the operation is greater than a small predefined value (called “⎕ct”, comparison tolerance, and you can change it).
The other (and more important) matter, — that is not even mentioned, — is comparison. E. g. in “rational by default in this specific case” languages (Perl 6),
> 0.1+0.2==0.3
True
Or, APL (now they are floats there! But comparison is special)