Skip to content

Commit 5c58688

Browse files
ZERICO2005mateoconlechuga
authored andcommitted
fix warning in powf and powl
1 parent f6e1fdc commit 5c58688

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/libc/powf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ float powf(float arg1, float arg2) {
3232
return expf( arg2 * logf( arg1 ) );
3333
}
3434
if ( arg1 < 0.0 ){
35-
temp = arg2;
36-
if ( temp == arg2 ){
35+
temp = (long)arg2;
36+
if ( (float)temp == arg2 ){
3737
result = expf( arg2 * logf( -arg1 ) );
3838
return temp & 1 ? -result : result;
3939
}

src/libc/powl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ long double powl(long double x, long double y) {
1818
return expl( y * logl( x ) );
1919
}
2020
if ( x < 0.0L ){
21-
temp = y;
22-
if ( temp == y ){
21+
temp = (long)y;
22+
if ( (long double)temp == y ){
2323
result = expl( y * logl( -x ) );
2424
return temp & 1 ? -result : result;
2525
}

0 commit comments

Comments
 (0)