/[escript]/trunk/escript/src/LocalOps.h
ViewVC logotype

Diff of /trunk/escript/src/LocalOps.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2881 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 2884 by jfenwick, Thu Jan 28 05:00:59 2010 UTC
# Line 41  namespace escript { Line 41  namespace escript {
41  inline  inline
42  bool nancheck(double d)  bool nancheck(double d)
43  {  {
44  #ifndef isnan       // Q: so why not just test d!=d?          // Q: so why not just test d!=d?
45      return false;   // A: Coz it doesn't always work [I've checked].          // A: Coz it doesn't always work [I've checked].
46  #else           // One theory is that the optimizer skips the test.          // One theory is that the optimizer skips the test.
47    #ifdef isnan
48      return isnan(d);      return isnan(d);
49    #elif defined _isnan
50        return _isnan(d);
51    #else
52        return false;
53  #endif  #endif
54  }  }
55    
# Line 55  bool nancheck(double d) Line 60  bool nancheck(double d)
60  inline  inline
61  double makeNaN()  double makeNaN()
62  {  {
63  #ifdef isnan  #ifdef nan
64      return nan("");      return nan("");
65  #else  #else
66      return sqrt(-1);      return sqrt(-1);

Legend:
Removed from v.2881  
changed lines
  Added in v.2884

  ViewVC Help
Powered by ViewVC 1.1.26