so am doing this exercise from my text book. and my code is as followed
public class Census{
public static void main(String[] args){
double population;
double birth = 86400/7;
double death = 86400/13;
double immigrant = 86400/45;
double total;
total = birth + immigrant - death;
total = total * 365;
population = total + 312032486;
System.out.println(population);
}
}
My output to the console is 3.14812326E8
When i do this problem step by step on my calculation i get the following output 312040102.7.
Why are the numbers so different?