6 ms·
Prelude> (0.1 + 0.2) == 0.3 False Prelude Ratio> 1 % 10 + 2 % 10 == 3 % 10 True
by Locke1689 17y ago
Prelude> (0.1 + 0.2) == 0.3
False
Prelude Ratio> 1 % 10 + 2 % 10 == 3 % 10
True
- jrockway 17y agoOr: ghci> 0.1 + 0.2 == (0.3 :: Ratio Int) True Same type, less syntax.
- regularfry 17y agoThat's cheating. Haskell isn't a language, it's The Word of Simon. The question of which Simon is left as an exercise to the reader.