我想找到四舍五入的方程式的值
I want to find the value of an equation with rounding down
x=[340,1123,3423,...] # x has random integers.
for i in x:
a= ~~~ that satisfied with int((x+a)*0.2)= int(x*0.2)+1
这样的话,这个a的计算方法是什么?
假设 int()
是一个舍入函数 我想使表达式像
a= ~~~
但是我想不出来。
a = 5
应该适用于所有 x
:
等式两边乘以5
得到round(x+a) - round(x) = 5
。如果 x
是一个整数,您将得到 a=5
。由于四舍五入 a = 6
和其他人应该工作。
x=[340,1123,3423,...] # x has random integers.
for i in x:
a= ~~~ that satisfied with int((x+a)*0.2)= int(x*0.2)+1
这样的话,这个a的计算方法是什么?
假设 int()
是一个舍入函数 我想使表达式像
a= ~~~
但是我想不出来。
a = 5
应该适用于所有 x
:
等式两边乘以5
得到round(x+a) - round(x) = 5
。如果 x
是一个整数,您将得到 a=5
。由于四舍五入 a = 6
和其他人应该工作。