PDA

View Full Version : 32bit Math example


IbarraE
09-22-2010, 06:15 PM
Here is SNAPpy code for doing 32bit addition and multiplication. It accepts only 4 byte binary strings for the arguments and returns a 4 byte binary string as the output.

IbarraE
09-22-2010, 08:34 PM
I updated this to be a little more user-friendly. It now has extra functions for formatting integers so you don't have to manually build the strings. In addition to that I updated the multiplier function to improve performance.

*Edit* - I realized after posting that there will a few bugs in the performance version. I've now corrected those.