Per comment from David Alession: M_E128 will never be used since it is greater than FLT_MAX.

This commit is contained in:
Gregory Nutt
2016-07-12 06:58:21 -06:00
parent 38999dfe9d
commit 3bc504b685
+6 -4
View File
@@ -49,13 +49,16 @@
#define M_E16 (M_E8 * M_E8) #define M_E16 (M_E8 * M_E8)
#define M_E32 (M_E16 * M_E16) #define M_E32 (M_E16 * M_E16)
#define M_E64 (M_E32 * M_E32) #define M_E64 (M_E32 * M_E32)
#define M_E128 (M_E64 * M_E64)
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static const float g_expif_square_tbl[8] = /* Values above M_E64 will never be used since its larger than FLT_MAX
*(3.402823e+38).
*/
static const float g_expif_square_tbl[7] =
{ {
(float)M_E, /* e^1 */ (float)M_E, /* e^1 */
(float)M_E2, /* e^2 */ (float)M_E2, /* e^2 */
@@ -64,7 +67,6 @@ static const float g_expif_square_tbl[8] =
(float)M_E16, /* e^16 */ (float)M_E16, /* e^16 */
(float)M_E32, /* e^32 */ (float)M_E32, /* e^32 */
(float)M_E64, /* e^64 */ (float)M_E64, /* e^64 */
(float)M_E128, /* e^128 */
}; };
/**************************************************************************** /****************************************************************************
@@ -76,7 +78,7 @@ float lib_expif(size_t n)
size_t i; size_t i;
float val; float val;
if (n > 128) if (n >= 128)
{ {
return INFINITY_F; return INFINITY_F;
} }