>>334 Squeak/Pharo Smalltalk

| sqrt |
sqrt := [:n :m |
 "ref. https://xar.sh/post/67066374255/ "
 | a b |
 a := 5 * n. b := 5.
 [:exit | [
  a >= b ifTrue: [a := a - b. b := b + 10] ifFalse: [
   b log > m ifTrue: [exit value] ifFalse: [
    a := a * 100. b := b // 10 * 100 + (b \\ 10)
   ]
  ]
 ] repeat] valueWithExit.
 b
].

#(3 5 7) collect: [:i | i -> (((sqrt value: i value: i*1000) asString first: i*1000) occurrencesOf: $0)]

"=> {3->309 . 5->493 . 7->738}"