the first thing thats suppose to happen in toDecimal is convert a binary number to positive, only if the binary number is a positive. if the binary number was a negative it would convert it to a positive, add 1 (two's complement), then convert to decimal(result).
The original function toDecimal converted a binary number to decimal.
all i did was add code to it so i could enter a two's complement number
and deal with it. obviously my code is wrong.
thanks for helping me.
George N. Bilios
|