Merge pull request #440 from kotet/issue-0433
Fix #433 merged-on-behalf-of: Basile-z <Basile-z@users.noreply.github.com>
This commit is contained in:
commit
999c044020
|
@ -448,6 +448,8 @@ private:
|
||||||
write(" ");
|
write(" ");
|
||||||
else if (prevTokenEndLine == currTokenLine || (t == tok!")" && peekIs(tok!"{")))
|
else if (prevTokenEndLine == currTokenLine || (t == tok!")" && peekIs(tok!"{")))
|
||||||
write(" ");
|
write(" ");
|
||||||
|
else if (t == tok!"else")
|
||||||
|
write(" ");
|
||||||
else if (canAddNewline || (peekIs(tok!"{") && t == tok!"}"))
|
else if (canAddNewline || (peekIs(tok!"{") && t == tok!"}"))
|
||||||
newline();
|
newline();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
int abs(int x)
|
||||||
|
{
|
||||||
|
if (x < 0) // x negative, must negate
|
||||||
|
return -x;
|
||||||
|
else // x already non-negative, just return it
|
||||||
|
return x;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
int abs(int x) {
|
||||||
|
if (x < 0)
|
||||||
|
// x negative, must negate
|
||||||
|
return -x;
|
||||||
|
else
|
||||||
|
// x already non-negative, just return it
|
||||||
|
return x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
int abs(int x) {
|
||||||
|
if (x < 0) // x negative, must negate
|
||||||
|
return -x;
|
||||||
|
else // x already non-negative, just return it
|
||||||
|
return x;
|
||||||
|
}
|
Loading…
Reference in New Issue