lib_expi/f(): Exponental table should be 'const'. Dimension was wrong for float version.

This commit is contained in:
Gregory Nutt 2016-07-11 13:53:31 -06:00
parent 6a081e118d
commit 29eae10232
2 changed files with 4 additions and 4 deletions

View File

@ -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];

View File

@ -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];