title: Numbers generation bad value
body: <p>I would like to implementing Bernoulli numbers generation in Scala. I select <a href="https://en.wikipedia.org/wiki/Bernoulli_number#Algorithmic_description" rel="nofollow">this algorithm</a>. I wrote following code:</p>
  
  <pre><code>def bernoulli(n: Int) = {
  
  val a: Array[Fraction] = Array.fill(n + 1) {
    new Fraction()
  }
  
  for (m &lt;- 0 to n) {
  
    a(m) = new Fraction(1, m + 1, 1 / (m + 1F))
  
    for (j &lt;- m to 1 by -1) {
  
      val vc = a(j - 1)
      vc.value= j * (vc.value - a(j).value)
    }
  
  }
  a.head
  
  
   }
  
    class Fraction(var numerator: Int = 0, var denominator: Int = 0, var value: Float = 0)
  </code></pre>
  
  <p>But when I print <code>bernoulli(5)</code> it is not 0.</p>