Printer FriendlyEmail Article Link

How do we convert an integer number into binary number in iTest.

Environment/Versions
  • iTest 4.3
Answer

Following code snippet will convert integer number to binary.
 

set i 10
set res {}
    while {$i>0} {
        set res [expr {$i%2}]$res
        set i [expr {$i/2}]
    }
 

puts $res              output:1010
 


Product : iTest Enterprise