Non-decimal radices/Convert: Difference between revisions
Content deleted Content added
Line 691:
set sum 0
foreach char [split $n ""] {
set sum [expr {($sum * $b) + [string first $char $chars]}]
}
return $sum
}
proc baseconvert::baseconvert {n basefrom baseto} {
dec2base [base2dec $n $basefrom] $baseto
}
namespace import baseconvert::baseconvert
|