This may seem like a stupid question but
What method can one use to convert a decimal number, such as $0.672$ into a whole number?
This isn't rounding as $0.999$ should result in $0$, but saying "floor the number" isn't an answer as I'm looking for a mathematical method in which a number, $n$, can be entered and would produce the same result as $floor(n)$.
For those familiar with programming, this is akin to the int function in many languages.
As asked in the comments, when given $-0.5$ the result should be $-1$ as it rounds to negative infinity.
Clarification: This is not about "what calculator can do what", this is about a mathematical question about a method of calculation. I used a calculator to prevent the smart-arse answers I usually get when I ask questions, not as something you can base your answer on.
As a programmer, given a float called
f, what I would do isIn English, you find the portion that is less than 1 by doing a modulus operation, and then subtract that amount. This only works with positive numbers; not sure if this works on negative numbers, and if it doesn't, how to handle them. The function above should probably check for values less than zero and return and error.