mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 04:38:10 +00:00
Per comment from David Alession: M_E128 will never be used since it is greater than FLT_MAX.
This commit is contained in:
parent
38999dfe9d
commit
3bc504b685
1 changed files with 6 additions and 4 deletions
|
|
@ -49,13 +49,16 @@
|
|||
#define M_E16 (M_E8 * M_E8)
|
||||
#define M_E32 (M_E16 * M_E16)
|
||||
#define M_E64 (M_E32 * M_E32)
|
||||
#define M_E128 (M_E64 * M_E64)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static const float g_expif_square_tbl[8] =
|
||||
/* Values above M_E64 will never be used since it’s larger than FLT_MAX
|
||||
*(3.402823e+38).
|
||||
*/
|
||||
|
||||
static const float g_expif_square_tbl[7] =
|
||||
{
|
||||
(float)M_E, /* e^1 */
|
||||
(float)M_E2, /* e^2 */
|
||||
|
|
@ -64,7 +67,6 @@ static const float g_expif_square_tbl[8] =
|
|||
(float)M_E16, /* e^16 */
|
||||
(float)M_E32, /* e^32 */
|
||||
(float)M_E64, /* e^64 */
|
||||
(float)M_E128, /* e^128 */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -76,7 +78,7 @@ float lib_expif(size_t n)
|
|||
size_t i;
|
||||
float val;
|
||||
|
||||
if (n > 128)
|
||||
if (n >= 128)
|
||||
{
|
||||
return INFINITY_F;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue