Updated SC2039 (markdown)

Rawiri Blundell
2016-10-14 21:26:48 +13:00
parent 3e8b8b9ff4
commit 3d3240d8fa

@@ -71,11 +71,13 @@ The POSIX standard does not allow for exponents. However, you can replicate the
```sh ```sh
pow () { pow () {
set $1 $2 1 set "$1" "$2" 1
while [ $2 -gt 0 ]; do while [ "$2" -gt 0 ]; do
set $1 $(($2-1)) $(($1*$3)) set "$1" $(($2-1)) $(($1*$3))
done done
echo $3 # %d = signed decimal, %u = unsigned decimal
# Either should overflow to 0
printf "%d\n" "$3"
} }
``` ```