Home > Net >  I want to find the value of an equation with rounding down
I want to find the value of an equation with rounding down

Time:04-02

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

In this case, what is the way to calculate this a?

Assume that int() is a rounding function I want to make an expression like

a= ~~~

But I can't come up with an idea.

CodePudding user response:

a = 5 should work for all x:

multiply both sides of the equation with 5 and you get round(x a) - round(x) = 5. if x is an integer you get a=5. and due to the rounding a = 6 and others should work.

  • Related