From 8bff8a97aab0c796a2e94e033c45f497414aa94c Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 25 Oct 2016 22:24:42 +0200 Subject: [PATCH] [liba] Implement isnan and isinf as specified by the C99 standard Change-Id: Ie767503568b7391d421a46052a1fc4a85b4006c7 --- liba/include/math.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/liba/include/math.h b/liba/include/math.h index a06b45113..74c48538e 100644 --- a/liba/include/math.h +++ b/liba/include/math.h @@ -5,8 +5,16 @@ LIBA_BEGIN_DECLS +/* The C99 standard requires isinf and isnan to be defined as macros that can + * handle arbitrary precision float numbers. The names of the functions called + * by those macros (depending on the argument size) are not standardized though. + * We're chosing isinff/isnanf for single-precision functions (which is the only + * case we're actually handling). */ + int isinff(float x); +#define isinf(x) isinff(x) int isnanf(float x); +#define isnan(x) isnanf(x) float copysignf(float x, float y); float cosf(float x);