* Source/NSDecimal.m (GSDecimalDouble): Use NAN when available.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25654 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2007-12-02 10:36:29 +00:00
parent a984255e57
commit 7728ffb868
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2007-12-02 David Ayers <ayers@fsfe.org>
* Source/NSDecimal.m (GSDecimalDouble): Use NAN when available.
2007-11-30 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/gdomap.h: fix typo

View file

@ -26,6 +26,7 @@
$Date$ $Revision$
*/
#define _GNU_SOURCE
#include <math.h>
#if !defined(__APPLE__) || !defined(GNU_RUNTIME)
#include <ctype.h>
@ -35,6 +36,10 @@
#include "Foundation/NSDictionary.h"
#include "Foundation/NSUserDefaults.h"
#ifndef NAN
#define NAN 0.0
#endif
/*
This file provides two implementations of the NSDecimal functions.
One is based on pure simple decimal mathematics, as we all learned it
@ -911,8 +916,7 @@ GSDecimalDouble(GSDecimal *number)
int i;
if (!number->validNumber)
// Somehow I dont have NAN defined on my machine
return 0.0;
return NAN;
// Sum up the digits
for (i = 0; i < number->length; i++)