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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3981 - (show annotations)
Fri Sep 21 02:47:54 2012 UTC (6 years, 9 months ago) by jfenwick
File MIME type: text/plain
File size: 1714 byte(s)
First pass of updating copyright notices
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2012 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 #ifndef INC_ESYS_MATHS
18 #define INC_ESYS_MATHS
19
20 /************************************************************************************/
21
22 /* Pull in a maths library and define ISNAN */
23
24
25 /* some system values */
26 /* FIXME: This is not satisfactory. */
27 /* _ECC, __INTEL_COMPILER, and other */
28 /* intel compiler pre-defines need to be handled */
29 /* (__ICL, __ICC come to mind) */
30 #if defined(_WIN32) && defined(__INTEL_COMPILER)
31 #include <mathimf.h>
32 #else
33 #include <math.h>
34 #endif
35
36 /*#ifndef NAN
37 #define NAN (0.0/0.0)
38 #endif
39 */
40 /*#define IS_NAN(__VAL__) ( (__VAL__) == NAN )*/ /* this does not work */
41 /* #define IS_NAN(__VAL__) ( ! ( ( (__VAL__) >= 0. ) || ( (__VAL__) <= 0. ) ) ) this does not work */
42
43 #ifdef isnan
44 #define IS_NAN(__VAL__) (isnan(__VAL__))
45 #elif defined _isnan
46 #define IS_NAN(__VAL__) (_isnan(__VAL__))
47 #else
48 /* If we do not have isnan then we can't reliably check for NaN - return false */
49 #define IS_NAN(__VAL__) (0)
50 #endif
51
52
53 #define EPSILON DBL_EPSILON
54 #define LARGE_POSITIVE_FLOAT DBL_MAX
55 #define SMALL_NEGATIVE_FLOAT -DBL_MAX
56
57 #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/pasowrap/esysUtils/src/maths.h:3661-3674 /branches/py3_attempt2/esysUtils/src/maths.h:3871-3891 /branches/restext/paso/src/Common.h:2610-2624 /branches/ripleygmg_from_3668/esysUtils/src/maths.h:3669-3791 /branches/stage3.0/paso/src/Common.h:2569-2590 /branches/symbolic_from_3470/esysUtils/src/maths.h:3471-3974 /branches/symbolic_from_3470/ripley/test/python/esysUtils/src/maths.h:3517-3974 /release/3.0/paso/src/Common.h:2591-2601 /trunk/ripley/test/python/esysUtils/src/maths.h:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26