lib_expi/f(): Exponental table should be 'const'. Dimension was wrong for float version.
This commit is contained in:
parent
6a081e118d
commit
29eae10232
@ -58,7 +58,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static double g_expi_square_tbl[11] =
|
||||
static const double g_expi_square_tbl[11] =
|
||||
{
|
||||
M_E, /* e^1 */
|
||||
M_E2, /* e^2 */
|
||||
@ -91,7 +91,7 @@ double lib_expi(size_t n)
|
||||
|
||||
for (i = 0; n; i++)
|
||||
{
|
||||
if (n & (1 << i))
|
||||
if ((n & (1 << i)) != 0)
|
||||
{
|
||||
n &= ~(1 << i);
|
||||
val *= g_expi_square_tbl[i];
|
||||
|
@ -55,7 +55,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static float g_expif_square_tbl[11] =
|
||||
static const float g_expif_square_tbl[8] =
|
||||
{
|
||||
(float)M_E, /* e^1 */
|
||||
(float)M_E2, /* e^2 */
|
||||
@ -85,7 +85,7 @@ float lib_expif(size_t n)
|
||||
|
||||
for (i = 0; n; i++)
|
||||
{
|
||||
if (n & (1 << i))
|
||||
if ((n & (1 << i)) != 0)
|
||||
{
|
||||
n &= ~(1 << i);
|
||||
val *= g_expif_square_tbl[i];
|
||||
|
Loading…
Reference in New Issue
Block a user