News for hackers. Stuff that matters.
Re:A little thing to love about Perl 6 and COBOL by arocks on Thursday February 05, 2015 @01:29AM (#9002045)
I prefer Python's explicit approach to decimal types:

  $ python -c "from decimal import Decimal as D; print(D('.1')+D('.2')-D('.3'))"
  0.0
Or if you prefer true rational numbers:

  $ python -c "from fractions import Fraction as F; print(F('.1')+F('.2')-F('.3'))"
  0

  $ python -c "from fractions import Fraction as F; print(F('3.1415927'))"
  31415927/10000000
Re:A little thing to love about Perl 6 and COBOL by herge on Thursday February 05, 2015 @08:32AM (#9003107)
What other languages call all-important features Python calls a module in the standard library :)
Re:A little thing to love about Perl 6 and COBOL by draegtun on Thursday February 05, 2015 @09:36AM (#9003388)
You could say the same thing about perl5 then :)

    $ perl -E "use bignum; say .1 + .2 - .3"
    0

    $ perl -E "use bigrat; say .1 + .2 - .3"
    0

    $ perl -E "use bigrat; say 3.1415927 / 1"
    31415927/10000000
ref: http://perldoc.perl.org/bignum.html | http://perldoc.perl.org/bigrat.html