Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1d0ecab

Browse files
add lower_bound const.
1 parent 7523f15 commit 1d0ecab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎leetcode/src/50.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ double myPow(double x, int n){
2222
return 1;
2323
}
2424

25-
// n is the minimum int -2147483648, couldn't be converted in -n because maximum is 2147483647.
26-
// this case we use 1 / (pow(x, -(n + 1)) * n)
27-
if (n == -2147483648){
25+
const int LOWER_BOUND = -2147483648;
26+
27+
// n is the minimum int, couldn't be converted in -n because maximum is 2147483647.
28+
// this case we use (1 / pow(x, -(n + 1))) * n
29+
if (n == LOWER_BOUND){
2830
return 1 / (powPositive(x, -(n + 1)) * x);
2931
}
3032

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /