Quantcast
Channel: Implement division using only addition - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 18

Answer by Johannes Kuhn for Implement division using only addition

$
0
0

Tcl, 0 additions

proc divide {a b} {    set sa [string repeat . $a]    set sb [string repeat . $b]    set sr ""    while 1 {        append sc $sb        if {[string le $sc]>[string le $sa]} break        append sr .    }    return [string le $sr]}

Why not use strings?


Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>