Python Forum
how do I show 12 numbers from a huge number?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do I show 12 numbers from a huge number?
#11
Not necessarily.
>>> 2**3**2
512
>>> (2**3)**2
64
>>> 2**(3**2)
512
>>> 
In selected cases it may be the same but not always.

Anyway, I tried using Decimal, other ideas and other than brute force slow I am at some loss. The answer, of course, is a binary expression of all zeros except for a 1 in the 1.717... billionth place.

Since the professor did not specify that it has to be in base 10 you could express this in base 2 and be done, but I think that will get you an F, or maybe a C- for cleverness.
Reply


Messages In This Thread
RE: how do I show 12 numbers from a huge number? - by jefsummers - Sep-02-2019, 12:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 1,473 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Convert list of numbers to string of numbers kam_uk 5 3,075 Nov-21-2020, 03:10 PM
Last Post: deanhystad
  Divide a number - Multiple levels - Sum of all numbers equal to input number pythoneer 17 8,912 Apr-20-2018, 04:07 AM
Last Post: pythoneer
  Trying to get the week number from a string of numbers fad3r 2 3,254 Apr-15-2018, 06:52 PM
Last Post: ljmetzger
  Regular Expressions in Files (find all phone numbers and credit card numbers) Amirsalar 2 4,138 Dec-05-2017, 09:48 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020