in reply to Subroutine not correct (I think)
printf OUT "%s to %s Distance=%.5f\n", $data[$i][0], $data[$j][0], $data[$i][2], $data[$j][2], distance(\@coords_i, \@coords_j);
Your printf statement has three placeholders, but you supply five elements of data to be printed.
return sqrt(($x - $x)**2 + ($y - $y)**2 + ($z - $z)**2);
The expression $x - $x will always be zero, as will the others.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutine not correct (I think)
by jcklasseter (Sexton) on Jun 17, 2015 at 13:10 UTC | |
by hippo (Archbishop) on Jun 17, 2015 at 14:28 UTC |