added emacs backup files to .gitignore
Fixed multiplication overflow function to not rely on undefined behavior.