Is there a function that allows you to generate the highest multiple of a number below a certain boundary?

51 Views Asked by At

Say for example, that I want the highest multiple of 36 below 100. Is there a function that allows me to generate this with two arbitrary numbers?

1

There are 1 best solutions below

0
On

If $x$ the number whose multiple you're trying to find and $y$ is the upper bound what you're looking for is $$x{\left\lfloor{ y\over x}\right\rfloor}$$

where $\lfloor\cdot\rfloor$ is the floor function.