News for hackers. Stuff that matters.
Re:WTFJS? by godDLL on Saturday February 13, 2010 @12:16PM (#1123194)
Could you please grace us with a code sample for all of these? I'm not intimately familiar with Haskell, Lisp or Ruby.

  >>> from decimal import *
  >>> Decimal('0.3') == Decimal('0.1') + Decimal('0.2')
  True
  >>> Decimal('NaN') == Decimal('NaN')
  False
  >>>
Re:WTFJS? by eslifka on Saturday February 13, 2010 @01:52PM (#1123339)
You only get that result in python by importing the decimal library. The standard behavior in python is (.1 + .2 == .3) == False

However, your code example makes the excellent point that python has such a library available, whereas Javascript does not. At least, not as easily as an import.