Updated SC2039 (markdown)

Mingye Wang
2020-05-12 13:02:18 +08:00
parent 25180a6788
commit a2aa39371f

@@ -94,10 +94,10 @@ POSIX:
The POSIX standard does not allow for exponents. However, you can replicate them completely built-in using a POSIX compatible function. As an example, the `pow` function from [here](http://unix.stackexchange.com/a/7925). The POSIX standard does not allow for exponents. However, you can replicate them completely built-in using a POSIX compatible function. As an example, the `pow` function from [here](http://unix.stackexchange.com/a/7925).
```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
# %d = signed decimal, %u = unsigned decimal # %d = signed decimal, %u = unsigned decimal
# Either should overflow to 0 # Either should overflow to 0