Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: perls long number problem

by gbarr (Monk)
on Dec 10, 2001 at 21:24 UTC ( [id://130712]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: perls long number problem
in thread perls long number problem

Perl can only handle integers up to the size it was configured with. But it can handle numbers larger that that. Try your example with

sprintf("%{$len}.0f",$number);

And you will see the number just fine. This is because perl uses doubles to hold real numbers, which can typically hold numbers of more bits. On most machines perl runs, integers are 32 bits and doubles use 53 bits for the mantissa.

So yes, perl can handle larger numbers without strings, providing you don't convert them to integers

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found