Homework #3

Your current error comes from your decimal construction. Just take one look at where you're defining your decimals. The math looks good but up against sys.maxint, it's got some precision problems.