Skip to content

Commit

Permalink
Merge pull request adambard#2909 from prertik/master
Browse files Browse the repository at this point in the history
[awk/en] fix for Local Variable in "arithmetic_functions"
  • Loading branch information
prertik authored Oct 14, 2017
2 parents ec62935 + 894ddf5 commit 8612e00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions awk.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ BEGIN {
a = count + 1
b = count - 1
c = count * 1
d = count / 1
d = count / 1 # integer division
e = count % 1 # modulus
f = count ^ 1 # exponentiation
Expand Down Expand Up @@ -143,7 +143,7 @@ BEGIN {
}
# Here's how you define a function
function arithmetic_functions(a, b, c, localvar) {
function arithmetic_functions(a, b, c, d) {
# Probably the most annoying part of AWK is that there are no local
# variables. Everything is global. For short scripts, this is fine, even
Expand Down

0 comments on commit 8612e00

Please sign in to comment.