1: module LA_XISNAN
2: interface LA_ISNAN
3:
4: module procedure SISNAN
5: module procedure DISNAN
6:
7: end interface
8:
9: contains
10:
11: logical function SISNAN( x )
12: use LA_CONSTANTS, only: wp=>sp
13: #ifdef USE_IEEE_INTRINSIC
14: use, intrinsic :: ieee_arithmetic
15: #elif USE_ISNAN
16: intrinsic :: isnan
17: #endif
18: real(wp) :: x
19: #ifdef USE_IEEE_INTRINSIC
20: sisnan = ieee_is_nan(x)
21: #elif USE_ISNAN
22: sisnan = isnan(x)
23: #else
24: sisnan = SLAISNAN(x,x)
25:
26: contains
27: logical function SLAISNAN( x, y )
28: use LA_CONSTANTS, only: wp=>sp
29: real(wp) :: x, y
30: SLAISNAN = ( x.ne.y )
31: end function SLAISNAN
32: #endif
33: end function SISNAN
34:
35: logical function DISNAN( x )
36: use LA_CONSTANTS, only: wp=>dp
37: #ifdef USE_IEEE_INTRINSIC
38: use, intrinsic :: ieee_arithmetic
39: #elif USE_ISNAN
40: intrinsic :: isnan
41: #endif
42: real(wp) :: x
43: #ifdef USE_IEEE_INTRINSIC
44: DISNAN = ieee_is_nan(x)
45: #elif USE_ISNAN
46: DISNAN = isnan(x)
47: #else
48: DISNAN = DLAISNAN(x,x)
49:
50: contains
51: logical function DLAISNAN( x, y )
52: use LA_CONSTANTS, only: wp=>dp
53: real(wp) :: x, y
54: DLAISNAN = ( x.ne.y )
55: end function DLAISNAN
56: #endif
57: end function DISNAN
58:
59: end module LA_XISNAN
CVSweb interface <joel.bertrand@systella.fr>