Changeset 11445


Ignore:
Timestamp:
02/14/12 11:56:44 (13 years ago)
Author:
Eric.Larour
Message:

NAN and INFINITY for Visual Studio win7 compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/include/typedefs.h

    r11092 r11445  
    2323/*Windows specific typefefs: */
    2424#ifdef _INTEL_WIN_
    25 #define NAN 0.0/0.0
    26 #define INFINITY 1.0/0.0
     25
     26/*Complicated way, which does not handle INFINITY though: */
     27/*#ifndef NAN
     28        static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
     29        #define NAN (*(const float *) __nan)
     30#endif*/
     31
     32//For reference, for Intel compile on win64
     33//#define NAN 0.0/0.0
     34//#define INFINITY 1.0/0.0
     35
     36//Most generic way it would seem:
     37#define INFINITY (DBL_MAX+DBL_MAX)
     38#define NAN (INFINITY-INFINITY)
     39       
    2740#endif
    2841
Note: See TracChangeset for help on using the changeset viewer.