aboutsummaryrefslogtreecommitdiff
path: root/src/mlp.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-09 21:56:21 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-09 21:56:21 -0500
commit15edb78b3e12d2b5c94e2354c91f354c881627de (patch)
tree1880716dfd3369dc66452bbbb3de54c49f4d66a2 /src/mlp.c
parent4fda6b01424aab5f6c5b13b1bd01697c899b6fcd (diff)
downloadlibopus-15edb78b3e12d2b5c94e2354c91f354c881627de.tar.gz
Making NaN detection more robust to -ffast-math.
Diffstat (limited to 'src/mlp.c')
-rw-r--r--src/mlp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mlp.c b/src/mlp.c
index 46386026..524e7711 100644
--- a/src/mlp.c
+++ b/src/mlp.c
@@ -75,6 +75,11 @@ static OPUS_INLINE float tansig_approx(float x)
return 1;
if (!(x>-8))
return -1;
+#ifndef FIXED_POINT
+ /* Another check in case of -ffast-math */
+ if (celt_isnan(x))
+ return 0;
+#endif
if (x<0)
{
x=-x;