NEURON
math.cpp
Go to the documentation of this file.
1 #ifdef HAVE_CONFIG_H
2 #include <../../nrnconf.h>
3 #endif
4 /*
5  * Copyright (c) 1991 Stanford University
6  * Copyright (c) 1991 Silicon Graphics, Inc.
7  *
8  * Permission to use, copy, modify, distribute, and sell this software and
9  * its documentation for any purpose is hereby granted without fee, provided
10  * that (i) the above copyright notices and this permission notice appear in
11  * all copies of the software and related documentation, and (ii) the names of
12  * Stanford and Silicon Graphics may not be used in any advertising or
13  * publicity relating to the software without the specific, prior written
14  * permission of Stanford and Silicon Graphics.
15  *
16  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  * IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
21  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
22  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
24  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
25  * OF THIS SOFTWARE.
26  */
27 
28 #include <stdlib.h>
29 #include <math.h>
30 #include <OS/math.h>
31 
32 /* would that these lived in a standard place ... */
33 #if defined(IVOS_FABS)
34 #define myfabs IVOS_FABS
35 #else
36 extern "C" {
37  extern int abs(int);
38  extern double fabs(double);
39 } // extern "C"
40 #define myfabs ::fabs
41 #endif
42 
43 int Math::abs(int x) { return ::abs(x); }
44 long Math::abs(long x) { return x >= 0 ? x : -x; }
45 double Math::abs(double x) { return myfabs(x); }
46 
47 
48 #include <InterViews/geometry.h>
49 
51 
54 }
#define Canvas
Definition: _defines.h:65
#define Coord
Definition: _defines.h:19
Coord left() const
Definition: geometry.h:297
void set_xy(Canvas *, Coord left, Coord bottom, Coord right, Coord top)
Definition: math.cpp:52
Coord top() const
Definition: geometry.h:300
Coord y_begin_
Definition: geometry.h:201
Coord x_end_
Definition: geometry.h:200
Coord bottom() const
Definition: geometry.h:298
Coord right() const
Definition: geometry.h:299
Extension()
Definition: math.cpp:50
Coord x_begin_
Definition: geometry.h:199
Coord y_end_
Definition: geometry.h:202
static int abs(int)
Definition: math.cpp:43
double fabs(double)
int abs(int)
#define myfabs
Definition: math.cpp:40
#define left
Definition: rbtqueue.cpp:45
#define right
Definition: rbtqueue.cpp:46