nuttx/libm: switch from integer to double constants in pow
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
parent
776035ee9e
commit
f0cbcb95ff
2 changed files with 6 additions and 6 deletions
|
@ -41,11 +41,11 @@
|
|||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
double pow(double b, double e)
|
||||
{
|
||||
if (b > 0)
|
||||
if (b > 0.0)
|
||||
{
|
||||
return exp(e * log(b));
|
||||
}
|
||||
else if (b < 0 && e == (int)e)
|
||||
else if (b < 0.0 && e == (int)e)
|
||||
{
|
||||
if ((int)e % 2 == 0)
|
||||
{
|
||||
|
@ -57,6 +57,6 @@ double pow(double b, double e)
|
|||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0.0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -37,11 +37,11 @@
|
|||
|
||||
float powf(float b, float e)
|
||||
{
|
||||
if (b > 0.0)
|
||||
if (b > 0.0f)
|
||||
{
|
||||
return expf(e * logf(b));
|
||||
}
|
||||
else if (b < 0.0 && e == (int)e)
|
||||
else if (b < 0.0f && e == (int)e)
|
||||
{
|
||||
if ((int)e % 2 == 0)
|
||||
{
|
||||
|
@ -53,5 +53,5 @@ float powf(float b, float e)
|
|||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue