Division always resulting in zero

Asked

Viewed 190 times

3

The Alpha result is only returning 0. Why?

package javaapplication4;

public class MediaMovelSuavizaçãoExp {


    public double CalculoPrevisao(double[] valores){

        double[] values = new double[valores.length];

        //Calculando o valor de alfa

        double alfa = 2 / ( values.length + 1);

        return alfa;
    }

}

1 answer

7


  • It worked out! Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.