Comparison of two integer saved in array

Discussion in 'Embedded Systems and Microcontrollers' started by ecaits, May 5, 2014.

  1. ecaits

    Thread Starter Member

    Jan 6, 2014
    52
    0
    Dear All Friends,

    I want to compare two integer array and want to know that which is greater. I have tried logic to compare MSB of each to LSB but I am not getting exact result.

    For Example.

    int data[5] = '12334" and int sample[5] = "11274" are two integer array and I want to compare that which array is greater.

    Plz suggest me how can I complete this?
     
  2. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,128
    266
    Subtract and test for carry condition- only way to get exact result.
     
Loading...