On Feb 2, 4:26 pm, Michael Sc <michael.schat... / gmail.com> wrote:
> Thank you very much.  I did not realize  it was so simple.  Do you know
> how to  refer to prior lines to make calculations?
>
> --
> Posted viahttp://www.ruby-forum.com/.

a =
[ ['alloy', 1.414],
  ['malign', 1.732],
  ['smudge', 2.0],
  ['smack', 2.236]
]

0.upto( a.size - 2 ) {|i|
  puts "Change from line #{i} to line #{i+1}:\
  #{ (a[i+1][1] - a[i][1]) / a[i][1] * 100 }%"
}