Seite 1 von 1

Trafficeinstellung mit mb:Fehler. Limit:200MB danach negativ

Verfasst: Mi 24.Dez, 2003 02:19
von Anonymous
Ich habe das Problem, dass ich bei der Einstellen der Trafficgröße ab 200mb nur noch negative Werte kriege, z.B.
für 204Mb wird es gesetzt,
für 205Mb habe ich den Wert -214538649 Bytes danach.

was kann ich denn falsch gemacht haben?
Alles andere scheint zu funktionieren (nach langem Forumlesen)

hier mal ein auszug aus meiner admin_dl_traffic_all_user.php

Code: Alles auswählen

$function = ( isset( $HTTP_POST_VARS['function']) ) ? $HTTP_POST_VARS['function'] : $HTTP_GET_VARS['function'];
$x = ( isset( $HTTP_POST_VARS['x']) ) ? $HTTP_POST_VARS['x'] : $HTTP_GET_VARS['x'];
if ($x == "bytes") $traffic_bytes = $traffic;
if ($x == "kb") $traffic_bytes = bcmul($traffic,1024,0);
if ($x == "mb") $traffic_bytes = bcmul($traffic,1048576,0);

und aus meiner functions_dl_bcmath.php

Code: Alles auswählen

function bcmul($a, $b, $scale)
{
$r = $a * $b;
for ( $i=0; $i < $scale; $i++);
$r = 10 * $r;
$r = ((int) $r);
for ( $i=0; $i < $scale; $i++);
$r = 0.1 * $r;
return $r;
}
es wundert mich, dass der Zahlenüberschlag bei 204,x MB erfolgt.

Weiß jemand, woran es liegt?