double returning only one precision in java
- by srinath
in my code i am performing division on numbers and storing it in a double variable. but the variable is returning with only one precision. i want to increase the precision how could i do that.
double x;
for ( int i =0 ; i<10000 ; i++)
{
x= w[i] / l[i];
System.out.println(x);
}
in the above code w and l are integer arrays;
i am getting output like
3.0
0.0
1.0
0.0
i want to increase the precision upto 4 atleast.