MarcoGT wrote:

>

> "Collin VanDyck" <(E-Mail Removed)> ha scritto nel messaggio

> news:W3P%b.9372043$(E-Mail Removed)...

>> "MarcoGT" <(E-Mail Removed)> wrote in message

>> news:c1odij$1m04i7$(E-Mail Removed)-berlin.de...

>> So what exactly is it you are trying to do? Please try and give more

>> information.

>

> I need to do sums ed subractions;

>

> for example i tried to make 111+1 and the result was 112...why?

>

> Thanks
Because 111 + 1 is 112 ofcourse

Seriously, all math in java is base 10 by default.

What you can do is retrieve your base 2 numbers in String form, convert them

to an int using Integer.parseInt("111",2), and add those ints. To get the

resulting base 2 representation, use Integer.toBinaryString on the sum, as

someone has mentioned before.

--

Kind regards,

Christophe Vanfleteren