pra não esquecer…

October 16th, 2009

cálculo exponencial de crescimento

Posted by Felipe Olivaes in PHP


$valor_inicial = 500;
$crescimento = 10; //em % +ou-
$numero_meses = 12;
if($crescimento < 0){
$resultado = $valor_inicial * pow(1-($crescimento/100), $numero_meses);
} else {
$resultado = $valor_inicial * pow(1+($crescimento/100), $numero_meses);
}


function _exp($valor, $perc, $meses){
$crescimento = $perc; //em % +ou-
$numero_meses = $meses;
if($crescimento < 0){
return ($valor * pow(1-($crescimento/100), $numero_meses));
} else {
return ($valor * pow(1+($crescimento/100), $numero_meses));
}
}

Leave a reply


 



nuvem de tags:

24 horas acentuação Apache bash benchmark bios boot celular centos charset comando console Download esxi Firebird firefox http importação intel ipod iscsi kinghost legenda Linux lost mod_deflate msn mssql MySQL owner Padel PHP placa mãe portabilidade Postgre SQL recovery root password shell sinuca sql server svn temporada completa veronica mars vmware Windows ícones