added fallback match::log2() code for platforms lacking log2

This commit is contained in:
2017-09-16 09:48:00 +00:00
parent a7bc6a6eb2
commit 36db3c8623
2 changed files with 6 additions and 6 deletions

View File

@ -359,7 +359,7 @@ static qse_awk_flt_t math_atan2 (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t
#endif
}
static qse_awk_flt_t math_log (qse_awk_t* awk, qse_awk_flt_t x)
static QSE_INLINE qse_awk_flt_t math_log (qse_awk_t* awk, qse_awk_flt_t x)
{
#if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_LOGQ)
return logq (x);
@ -385,7 +385,7 @@ static qse_awk_flt_t math_log2 (qse_awk_t* awk, qse_awk_flt_t x)
#elif defined(HAVE_LOG2F)
return log2f (x);
#else
#error ### no log2 function available ###
return math_log(x) / math_log(2.0);
#endif
}