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

  • Home
  • SEARCH
  • 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 7761703
In Process

The Archive Base Latest Questions

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

I’m planning to use very big numbers in Python, but wonder if Python can

  • 0

I’m planning to use very big numbers in Python, but wonder if Python can handle very big numbers. The numbers are going to have up to 3,000 zeros.

And, how much bytes does a 1 with 3,000 zeros use?

Third question, how can I save a number as integer into a file with Python without having to str() it?

  • 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-01T14:12:18+00:00Added an answer on June 1, 2026 at 2:12 pm

    Python can store arbitrarily long integers using the long type and even lets you specify long literals by appending an L to them (e.g. 0L is a long zero, as opposed to just 0 which is an int). Even better, it automatically “promotes” numbers from ints to longs when the result of a calculation is too large to be represented by an int. long is a full-fledged numeric type and is compatible with all Python numeric operations.

    If you need more than integers, then you want the decimal module, which features a Decimal type that provides real numbers of arbitrary size and precision, without the issues inherent to binary floating-point representations.

    The downside of both long and Decimal is that they are slower than int and float, respectively, because the latter have native hardware support. But doing math on large numbers somewhat slowly beats not being able to use such numbers at all.

    As for size, int objects are 12 bytes in 32-bit Python. This seemingly large size for what is internally a 32-bit quantity is due to Python’s “everything’s an object” approach. (I believe, but don’t quote me, that there’s 4 bytes for the value, 4 bytes for a pointer from the instance to the type, and 4 bytes for a reference counter, which is used to determine when an object can be garbage-collected. These fields may be larger on 64-bit versions of Python.)

    The size of a long varies, as they vary based on the number (plus object overhead), but the size of any long value can be determined using sys.getsizeof().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported

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.