Movatterモバイル変換


[0]ホーム

URL:


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

Commitec1138e

Browse files
Add C++ implementation
Signed-off-by: begeekmyfriend <begeekmyfriend@gmail.com>
1 parent425b077 commitec1138e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎0050_pow/pow.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
#include<stdio.h>
33
#include<stdlib.h>
44

5-
staticdoublefast_pow(doublex,intn)
5+
6+
doublefast_pow(doublex,intn)
67
{
78
if (n==0) {return1.0; }
89
if (n==1) {returnx; }
910
doublet=fast_pow(x,n /2);
1011
returnn&1 ?t*t*x :t*t;
1112
}
1213

13-
staticdoublemy_pow(doublex,intn)
14+
doublemy_pow(doublex,intn)
1415
{
1516
if (n==INT_MIN) {
1617
doublet=1 /fast_pow(x,-(n /2));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp