# Largest Factorial Represented Exactly In Floating Point System

Printable View

• Sep 12th 2011, 11:20 AM
mathematicalbagpiper
Largest Factorial Represented Exactly In Floating Point System
"Find the largest integer $n$ such that $n!$ can be represented exactly in the floating point number system where the base is 2, the precision is 24, and the exponent ranges from -100 to 100.

Well, I don't even know where to start. I think it has something to do with expressing factorials as powers of 2, but other than that I haven't a bloody clue.
• Sep 12th 2011, 12:44 PM
CaptainBlack
Re: Largest Factorial Represented Exactly In Floating Point System
Quote:

Originally Posted by mathematicalbagpiper
"Find the largest integer $n$ such that $n!$ can be represented exactly in the floating point number system where the base is 2, the precision is 24, and the exponent ranges from -100 to 100.

Well, I don't even know where to start. I think it has something to do with expressing factorials as powers of 2, but other than that I haven't a bloody clue.

Well the number of binary digits is $b=\lceil \lg(n!) \rceil$

Of these $z=\lfloor n/2 \rfloor + \lfloor n/4 \rfloor + ... + \lfloor n/2^{\lfloor\lg(n)\rfloor} \rfloor$ are zeros.

So you now need $b-z\le 24$ and $z \le 100$

Now trial and error should find the answer pretty quickly (it is less than 20)

CB