From 4f81a60ef662886009f8a596485f6dafeb58d064 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 May 2016 06:31:04 -0600 Subject: [PATCH] Add a NAN test on 'x' in asin function of lib_asin.c. Suggested by Pierre-noel Bouteville. --- libc/math/lib_asin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/math/lib_asin.c b/libc/math/lib_asin.c index 08a2dc9573..2f45a24a1d 100644 --- a/libc/math/lib_asin.c +++ b/libc/math/lib_asin.c @@ -3,7 +3,7 @@ * * This file is a part of NuttX: * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Ported by: Darcy Gong * * It derives from the Rhombs OS math library by Nick Johnson which has @@ -55,7 +55,7 @@ double asin(double x) /* Verify that the input value is in the domain of the function */ - if (x < -1.0 || x > 1.0) + if (x < -1.0 || x > 1.0 || isnan(x)) { return NAN; }