# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 13:32:54 2026

@author: François Coulombeau
"""
import numpy as np

def pi(prec=1e-8):
    S=0
    f=1
    k=0
    while 4/(2*k+3) >= prec:
        S += f/(2*k+1)
        f *= -1
        k += 1
    return 4*S

print(pi())