Binary Search Problem 34

Back to General discussions forum

Vishnuprasad-code     2020-04-16 09:36:26

''' import math l=int(input()) for n in range(l): A,B,C,D=list(map(float,input().split())) start=0 end=100 while(start<=end): mid=int((start+end)/2) x=mid f=Ax + Bmath.sqrt(x3) - Cmath.exp(-x/50) -D if (f==0): x=mid break if(f<0): start=mid+1 x=mid else: end=mid-1 i=0.1 for j in range(7): while(f<=0): x=x+i f=Ax + B*math.sqrt(x3) - C*math.exp(-x/50) -D x=x-i i=i/10 print(x," ")'''

^ this is my code
I am getting an answer nu without the said precision. Can anyone point out what i am doing wrong?
elolpuer     2020-04-16 12:56:06

print('%.7f' % x, ' ')

Please login and solve 5 problems to be able to post at forum