Find an expression for the ones digit of a positive integer using a floor or ceiling function.

91 Views Asked by At

I am trying to find out how to write an expression for the ones digit for any given positive integer. For example, if n = 326, the expression should evaluate to 6. The only things I've been able to think of are using a ceiling function such that:

$$ \frac{\lfloor n \rfloor}{n^2} $$

But I don't know how to solve this without just guessing and hoping for the right answer.

1

There are 1 best solutions below

0
On

Here you go:$$x-10\lfloor x/10 \rfloor $$