Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
trail multiplication
#tclsh 8.6 gets stdin value1 gets stdin value2 proc dec2bin int { set binRep [binary format c $int] binary scan $binRep B* binStr return $binStr } set a [ dec2bin $value1 ] puts $a set b [ dec2bin $value2 ] puts $b proc mul { c d } { set sum 0 while {$d!=0} { set sum [expr 0b$sum + 0b$c] set d [expr 0b$d - 0b1] } return $sum } puts [mul $a $b]
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
NISP - Planning ID Unit Test
fl mul bin
NISP - Wheel Movements 0.1
Santosh bin mul eo
Practice TCL
Counting occurences of substring in string
Working for neg
NISP - Planning ID Unit Test
Trail
Add Dec2bin
Please log in to post a comment.