Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

p0, percent, aug (inhabitants coming or leaving each year), p (population to surpass)

function nbYear(p0, percent, aug, p) {
  let n = 0;
  while(p0 < p) {
  p0 = p0 + Math.round(p0 * (percent/100)) + aug;
  n ++;
  }

return n;
}
 
PREVIOUS NEXT
Tagged: #aug #coming #leaving
ADD COMMENT
Topic
Name
4+1 =