numbers with two decimal places
hey, wanna calculate some normal stuff, but my code is not giving out the exact decimal places, it is always putting a 0 there... i have no clue why...
this is my code:
public class rechnen
{
private double[] array = {1,2,3,4,5,6,7,8,9,10,11,30};
public void Stats()
{
double q1 = array[((array.length)/4)];
double q2 = array[((array.length+1)/2)];
double q3 = array[((array.length*3)/4)];
double lr = (double)(((1.5)*(q3-q1)));
System.out.println(q1);
System.out.println(q2);
System.out.println(q3);
System.out.println(lr);
System.out.println(q1);
}
public static void main(String[] args)
{
rechnen app = new rechnen();
app.Stats();
}
}
and it is giving out:
4.0
7.0
10.0
9.0
4.0
but the 10.0 should be 10.5 so what is going wrong here and if i wann sort this number with radix sort, do i have to change all the int into double or sth. else..
thank u so much that u r always helping me...
little_polarbear