#Can anyone here answer this question pls ?

10 messages · Page 1 of 1 (latest)

sly echo
#

Any given base? It'll be different for every base below 1000

past surge
#

No

sly echo
#

Actually thinking about it, it'll be different in every base.

#

Are you asking how to compute the 1000th digit in other bases?

past surge
#

Thank you next

#

A hint

#

To find the exact value of the 1000th decimal of pi in any given base b other than base-10, you can use the decimal module in Python to represent pi to a high degree of accuracy and then convert it to the desired base. Here's an example code snippet that shows how to do this:

from decimal import Decimal

# Define the desired base
b = 2

# Set the precision for pi using the decimal module
precision = 1001
pi = Decimal(22).divmod(7)
pi = pi.quantize(Decimal('.' + '0'*(precision-1) + '1'))

# Convert pi to the desired base
pi_str = str(pi).split('.')
pi_int = int(pi_str[0])
pi_frac = pi_str[1]
pi_frac = [int(x) for x in str(pi_frac)]
result = ""
sly echo
#

22/7 isn't Pi. It's an approximation of pi.

#

!exec ```py
import math

print(math.pi)
print(22/7)

haughty oysterBOT