How to find the nearest factorial to a number

How can I find the nearest Factorial to a number? For example I know that the nearest factorial to 200 is 5! So how can I also find out the nearest factorial to another number 2864785456?

Thanks.

• Possible duplicate of Inverse of a factorial. – robjohn Feb 4 at 10:20
• – lhf Feb 4 at 10:21
• I would suggest to solve $$\Gamma(x+1)=n$$ numerically and correctly round. – Peter Feb 4 at 10:33