in reply to Floating point hell

Just to pound this completely into the ground:

c:\@Work\Perl>perl -wMstrict -le "my @leftEq = ([-8]); my @rightEq = ([-8]); ;; my @leftStorDelta = (-15); my @rightStorDelta = (-15); ;; $_[0] = 0; my $i = 0; my $factor = 0.5; ;; print \"LEQ/REQ: $leftEq[$_[0]][$i] $rightEq[$_[0]][$i]\n\"; ($leftEq[$_[0]][$i], $rightEq[$_[0]][$i]) = ($leftEq[$_[0]][$i] + $leftStorDelta[$i] * $factor, $rightEq[$_[0]][$i] + $rightStorDelta[$i] * $factor); print \"Fct: $factor Delt: $leftStorDelta[$i] $rightStorDelta[$i]\n\" +; print \"Post-LEQ/REQ: $leftEq[$_[0]][$i] $rightEq[$_[0]][$i]\n\n\"; " LEQ/REQ: -8 -8 Fct: 0.5 Delt: -15 -15 Post-LEQ/REQ: -15.5 -15.5
And further to AnonyMonk's point above, I get your undesired  -8 -8 results if I just  use integer; before the computation.


Give a man a fish:  <%-{-{-{-<