不用math.sqrt()函数,暴力解方程,直接~ 粗暴~
Topic source#其实连公式都可以不用变:
x = abs(c)
s = []
while abs(x) <= abs(c):
if a*x**2 + b*x + c ==0:
s.append(x)
x = round(x - 0.01, 2)
return tuple(s)
- 1
#其实连公式都可以不用变:
x = abs(c)
s = []
while abs(x) <= abs(c):
if a*x**2 + b*x + c ==0:
s.append(x)
x = round(x - 0.01, 2)
return tuple(s)
仙羽_幻境
''' 用到了round(),说起这个就是泪啊 吗的,这个Python有毒,小数点计算的时候会有BUG, 大家测试一下吧: ''' x=1.0 while x>0 : x=x-0.1 print(x)