in reply to time() function

Maybe the perl hackers (as apposed to the Perl hackers) can correct me: your typical integer (x86 arch) is going to be 32bits. time returns an integer, and 1000 is an integer, so perl's going to return the results as an integer too. But the largest number a signed integer can express is roughly 2 billion. Time just spilled over into the 1 billions fairly recently. So the result is overflowing, giving you the "inaccurate" answer.

See how Math::BigInt works out for you.

-Ducky

Replies are listed 'Best First'.
Re: Re: time() function
by BrentDax (Hermit) on Sep 28, 2001 at 22:07 UTC
    That's right. You can use a special build option (-Duse64bit, IIRC) on some platforms(including Linux) to get 64-bit ints, which I think go into the trillions without overflowing.

    =cut
    --Brent Dax
    Perl 6 Configure pumpking
    There is no sig.