Check for NaN and set error accordingly

svn path=/trunk/; revision=54447
This commit is contained in:
Pierre Schweitzer 2011-11-19 19:01:58 +00:00
parent ada492283a
commit 7d1620fa34

View file

@ -19,11 +19,22 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#include <precomp.h>
#include <math.h> #include <math.h>
#include <float.h>
double ldexp (double value, int exp) double ldexp (double value, int exp)
{ {
register double result; register double result;
/* Check for value correctness
* and set errno if required
*/
if (_isnan(value))
{
errno = EDOM;
}
#ifdef __GNUC__ #ifdef __GNUC__
#if defined(__clang__) #if defined(__clang__)
asm ("fild %[exp]\n" asm ("fild %[exp]\n"