For example, if the number is 12345 then 2 digits from the left would be 12, and from the right would be 45.

I know that this can be easily solved if the number is converted to a string of characters and then converted back into a number, but I was curious if there is an efficient mathematical way to solve this?

Perhaps using functions like min, max, floor, pow, sqrt, etc.?

Thanks.