Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7707183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:17:44+00:00 2026-06-01T00:17:44+00:00

How can I assign the maximum value for a long integer to a variable,

  • 0

How can I assign the maximum value for a long integer to a variable, similar, for example, to C++’s LONG_MAX.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:17:46+00:00Added an answer on June 1, 2026 at 12:17 am

    Long integers:

    There is no explicitly defined limit. The amount of available address space forms a practical limit.
    (Taken from this site). See the docs on Numeric Types where you’ll see that Long integers have unlimited precision. In Python 2, Integers will automatically switch to longs when they grow beyond their limit:

    >>> import sys
    >>> type(sys.maxsize)
    <type 'int'>
    >>> type(sys.maxsize+1)
    <type 'long'>
    

    for integers we have

    maxint and maxsize:

    The maximum value of an int can be found in Python 2.x with sys.maxint. It was removed in Python 3, but sys.maxsize can often be used instead. From the changelog:

    The sys.maxint constant was removed, since there is no longer a limit
    to the value of integers. However, sys.maxsize can be used as an
    integer larger than any practical list or string index. It conforms to
    the implementation’s “natural” integer size and is typically the same
    as sys.maxint in previous releases on the same platform (assuming the
    same build options).

    and, for anyone interested in the difference (Python 2.x):

    sys.maxint The largest positive integer supported by Python’s regular
    integer type. This is at least 2**31-1. The largest negative integer
    is -maxint-1 — the asymmetry results from the use of 2’s complement
    binary arithmetic.

    sys.maxsize The largest positive integer supported by the platform’s
    Py_ssize_t type, and thus the maximum size lists, strings, dicts, and
    many other containers can have.

    and for completeness, here’s the Python 3 version:

    sys.maxsize
    An integer giving the maximum value a variable of type Py_ssize_t can take. It’s usually 2^31 – 1 on a 32-bit platform and
    2^63 – 1 on a 64-bit platform.

    floats:

    There’s float("inf") and float("-inf"). These can be compared to other numeric types:

    >>> import sys
    >>> float("inf") > sys.maxsize
    True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how i can assign rjs prompt value to a variable page << prompt('Enter the
can we assign a data column value to a variable and use this variable
For example, i can assign the result of function call to a variable. Or
I know you can assign a function's return value to a variable and use
My question is if we can assign/bind some value to a certain item and
In order to return a value from a VB.NET function one can assign a
In UNIX you can assign the output of a script to an environment variable
How I can assign a sequence value to a field UID which is NUll
You know how you can assign a temporary column name to a return value
I can assign one struct's value to another and the memory gets copied automatically.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.