Of course your subtraction doesn't work... how were you taught math at school when your teacher told you how to subtract numbers? Whatever you 'borrow' from the preceeding column has to be added into the column you are working on. Apply the same subtraction method you were taught when you were seven years old here. xhigh and xlow are simply your two columns of numbers.