BigInteger

Integers & longs can only hold numbers up to 2**31 and 2**63 respectively. In an attempt to solve this problem, I wrote up a solution for computing the factorial with long and after a certain number, I started getting negative results! Longs are signed which effectively means I have 2**31 positive long values and 2**31 negative long values. 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.