Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

First of all, thanks for your quick answer.

Perl's maximum values for integers can be determined

That is brilliant, thanks.

If you want to work with integers larger than that, use Math::BigInt.

I do not really want to work with larger integers. I want to allow up to the maximum unsigned integer value in the current Perl. I would rather avoid the overhead of using Math::BigInt if I can.

To validate number formats, use Regexp::Common::number.

How are these regular expressions going to help? Say the current Perl uses 32-bit integers. How is a regular expression going to help me accept 4294967295 (UINT32_MAX) but not 4294967296 (UINT32_MAX+1)?

Say Perl automatically "upgrades" UINT64_MAX + 1 to a floating-point value, and the platform uses 64-bit integers but also 64-bit floating point values. Is that not going to lose some precision? How can I then accept exactly up to UINT64_MAX but not UINT64_MAX + 1 ?


In reply to Re^2: Reliably parsing an integer by rdiez
in thread Reliably parsing an integer by rdiez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-23 16:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found