/[escript]/trunk/esysUtils/src/maths.h
ViewVC logotype

Contents of /trunk/esysUtils/src/maths.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (8 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 1573 byte(s)
Merging dudley and scons updates from branches

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #ifndef INC_ESYS_MATHS
16 #define INC_ESYS_MATHS
17
18 /**************************************************************/
19
20 /* Pull in a maths library and define ISNAN */
21
22
23 /* some system values */
24 /* FIXME: This is not satisfactory. */
25 /* _ECC, __INTEL_COMPILER, and other */
26 /* intel compiler pre-defines need to be handled */
27 /* (__ICL, __ICC come to mind) */
28 #if defined(_WIN32) && defined(__INTEL_COMPILER)
29 #include <mathimf.h>
30 #else
31 #include <math.h>
32 #endif
33
34 /*#ifndef NAN
35 #define NAN (0.0/0.0)
36 #endif
37 */
38 /*#define IS_NAN(__VAL__) ( (__VAL__) == NAN )*/ /* this does not work */
39 /* #define IS_NAN(__VAL__) ( ! ( ( (__VAL__) >= 0. ) || ( (__VAL__) <= 0. ) ) ) this does not work */
40
41 #ifdef isnan
42 #define IS_NAN(__VAL__) (isnan(__VAL__))
43 #elif defined _isnan
44 #define IS_NAN(__VAL__) (_isnan(__VAL__))
45 #else
46 /* If we do not have isnan then we can't reliably check for NaN - return false */
47 #define IS_NAN(__VAL__) (0)
48 #endif
49
50
51 #define EPSILON DBL_EPSILON
52 #define LARGE_POSITIVE_FLOAT DBL_MAX
53 #define SMALL_NEGATIVE_FLOAT -DBL_MAX
54
55 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/paso/src/Common.h:2682-2741 /branches/restext/paso/src/Common.h:2610-2624 /branches/stage3.0/paso/src/Common.h:2569-2590 /release/3.0/paso/src/Common.h:2591-2601

  ViewVC Help
Powered by ViewVC 1.1.26