gildir has asked for the wisdom of the Perl Monks concerning the following question:
This code will produce these results: 739.3, 739.3 and false.warn $obj1->value; warn $obj2->value; warn ($obj1->value == $obj2->value);
There was a meaningful result: 1.13686837721616e-13warn ($obj1->value - $obj2->value);
Now I understand that these two numbers are in fact different, but why does warn $number display the wrong (rounded) value? How can I control this behavior of warn?
What I was trying to achieve is a warning message like 'The numbers X and Y are different!' but it looks more than little stupid to display message 'The numbers 739.3 and 739.3 are different!'.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Strange (rounding?) problem
by iakobski (Pilgrim) on May 02, 2001 at 14:41 UTC | |
by tye (Sage) on May 02, 2001 at 19:44 UTC | |
Re: Strange (rounding?) problem
by jeroenes (Priest) on May 02, 2001 at 14:02 UTC | |
(stephen) Re: Strange (rounding?) problem
by stephen (Priest) on May 02, 2001 at 14:31 UTC | |
Re: Strange (rounding?) problem
by alfie (Pilgrim) on May 02, 2001 at 14:07 UTC | |
by Eureka_sg (Monk) on May 02, 2001 at 14:30 UTC | |
by iakobski (Pilgrim) on May 02, 2001 at 14:48 UTC | |
Re: Strange (rounding?) problem
by Beatnik (Parson) on May 02, 2001 at 15:58 UTC |