Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: time() function

by ducky (Scribe)
on Sep 28, 2001 at 21:28 UTC ( [id://115453]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://115453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-20 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found