in reply to Re^5: floating point addition
in thread floating point addition
The last two cases is where one can see the difference that bigrat makes, but should the comparison in the second case not yield false?perl -e 'print 201/10 == 20.10000000000000000 ? "eq" : "ne"' eq perl -Mbigrat -e 'print 201/10 == 20.10000000000000000 ? "eq" : "ne"' eq perl -e 'print 201/10 == 20.10000000000000142 ? "eq" : "ne"' eq perl -Mbigrat -e 'print 201/10 == 20.10000000000000142 ? "eq" : "ne" +' ne
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: floating point addition
by choroba (Cardinal) on Jan 13, 2015 at 08:39 UTC |