@ 2012-08-17T11:57:04Z <?php
function calculValeurEcoGes($valeur, $type = 1)
{
$intervalles = array( // Indice 1= Eco, Indice 2=GES
1 => array ('A' => array(0, 50), 'B' => array(51, 90), 'C' => array(91, 150), 'D' => array(151, 230), 'E' => array(231, 330), 'F' => array(331, 450), G => array(451, 99999)),
2 => array('A' => array(0, 5), 'B' => array(6, 10), 'C' => array(11, 20), 'D' => array(21, 35), 'E' => array(36, 55), 'F' => array(56, 80), 'G' => array(81, 99999))
);
if($type < 1 || $type > 2) {
exit("Erreur, le type de valeur éco. doit être compris entre 1 et 2");
}
$intervalle = $intervalles($type);
foreach($intervalle as $lettre => $minMax) {
lit($min, $max) = $minMax;
if($valeur >= $min && $valeur <= $max) {
return $lettre;
}
}
return 'Z';
}
echo calculValeurEcoGes(40, 1);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.6 0.023 0.050 16.33 5.4.5 0.023 0.033 16.43 5.4.4 0.033 0.047 16.43 5.4.3 0.020 0.050 16.42 5.4.2 0.023 0.070 16.17 5.4.1 0.037 0.060 16.51 5.4.0 0.027 0.047 15.94 5.3.16 0.033 0.067 14.46 5.3.15 0.027 0.073 14.69 5.3.14 0.027 0.073 14.54 5.3.13 0.027 0.067 14.64 5.3.12 0.030 0.063 14.79 5.3.11 0.027 0.073 14.79 5.3.10 0.027 0.033 13.95 5.3.9 0.023 0.040 14.00 5.3.8 0.020 0.053 14.08 5.3.7 0.027 0.073 14.11 5.3.6 0.023 0.070 13.93 5.3.5 0.033 0.063 14.01 5.3.4 0.037 0.043 14.12 5.3.3 0.027 0.067 13.83 5.3.2 0.023 0.047 13.68 5.3.1 0.020 0.060 13.58 5.3.0 0.027 0.047 13.63
preferences:dark mode live preview
139.11 ms | 1394 KiB | 7 Q