mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2039 (markdown)
@@ -95,9 +95,9 @@ 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
|
||||||
# %d = signed decimal, %u = unsigned decimal
|
# %d = signed decimal, %u = unsigned decimal
|
||||||
# Either should overflow to 0
|
# Either should overflow to 0
|
||||||
|
Reference in New Issue
Block a user