From a2aa39371feb1ad627247979d0cb293414b407eb Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Tue, 12 May 2020 13:02:18 +0800 Subject: [PATCH] Updated SC2039 (markdown) --- SC2039.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SC2039.md b/SC2039.md index 7bff1bd..9daf4ac 100644 --- a/SC2039.md +++ b/SC2039.md @@ -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). ```sh -pow () { - set "$1" "$2" 1 +pow() { + set -- "$1" "$2" 1 while [ "$2" -gt 0 ]; do - set "$1" $(($2-1)) $(($1*$3)) + set -- "$1" $(($2-1)) $(($1*$3)) done # %d = signed decimal, %u = unsigned decimal # Either should overflow to 0