Julian Haupt wrote:
>+    if ($date =~ s/\.(\d+)$// )
>+    {
>+      my $fraction = $1;
>+      $p{'nanosecond'} = (1 / $fraction) * 10**9;
>+    }

That inversion can't be right.  Surely you mathematically want

        $p{'nanosecond'} = "0.$fraction" * 10**9;

but actually the nanoseconds member is supposed to be an integer, and
it would be better to avoid floating-point arithmetic entirely:

        $fraction = substr($fraction, 0, 9);
        $fraction .= "0" x (9 - length($fraction);
        $p{'nanosecond'} = 0 + $fraction;

-zefram

Reply via email to