integer to binary bits

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Muhs

    integer to binary bits

    Hi all!!

    Im working with mutation testing...

    i have a file which consist of data like this
    10110011
    10110111
    01010001

    i read the file and store it in an integer array... now i want to use
    the integer as seperate bits like the first one as, 1,0,1,1,0,0,1,1 .
    This is because i wnat to find the hamming distance between the two
    integers. Can any one of you tell me how to do it...
  • christery@gmail.com

    #2
    Re: integer to binary bits

    On 18 Feb, 20:37, Muhs <shumy...@gmail .comwrote:
    Hi all!!
    >
    Im working with mutation testing...
    >
    i have a file which consist of data like this
    10110011
    10110111
    01010001
    >
    i read the file and store it in an integer array... now i want to use
    the integer as seperate bits like the first one as, 1,0,1,1,0,0,1,1 .
    This is because i wnat to find the hamming distance between the two
    integers. Can any one of you tell me how to do it...
    Havent a clue to what you are asking... but its a bit late...

    checked out http://www.vldb.org/conf/2002/S10P02.pdf and it got me
    more confused...
    all data in a normal computer is binary and can be treated as such,

    so as jon said u can always in a integer anyway check if a bit is 1 or
    not by and...

    but hamming distance... mutation testing... difference between two
    integers.. thats "-"

    Got some pseudo code out of thet article and I dont catch a thing...

    initialise c[1; 1] : : : c[m; log n] = 0
    for all tuples (i; dk) do
    for j = 1 to m do
    c[j; hashj(i)] = c[j; hashj(i)] + dk
    for j = 1 to m do
    for k = log n downto 1 do
    if c[j; k] = 0 then
    minzero = k
    total = total + minzero
    return(1:2928  2total=m)

    well, go look it up in the pdf.. if you dont trust me...

    //CY

    Comment

    Working...