I was getting bored of having to convert between binary and decimal to find examples for binary arithmetc, so I decided to write a package which automatically interprets all input numeric values as binary numbers, makes the appropriate calculation (by converting back to decimal, doing the operation and then converting back to binary. Some examples are: > with( BinaryArithmetic ): > 10101 + 1001; 11110 > 1001001^101; 1111011100100001000111111101001 > 101001.0011^0.01101; 100.1000011 > %^(1/0.01101); 101001.0000 > Digits := 30: % use 30 bits of accuracy > 101001.0011^0.01101; 100.100001110110100111100111001 > %^(1/0.01101); 101001.001011111111111111111100 If you want to see this package, take a look at http://cheetah.vlsi.uwaterloo.ca/~dwharder/maplesque/ One thing it doesn't do right now is calculate functions like sin and cos, for example, if you type sin(10.0), you will still get the sine of ten radians. If anyone sees any reason for including some additional functions into this package, let me know and I can add them.

Please Wait...