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
50
Extension::Extension
() {}
51
52
void
Extension::set_xy
(
Canvas
*,
Coord
left
,
Coord
bottom,
Coord
right
,
Coord
top) {
53
x_begin_ =
left
; y_begin_ = bottom; x_end_ =
right
; y_end_ = top;
54
}
math.h
fabs
double fabs(double)
Extension::Extension
Extension()
Definition:
math.cpp:50
abs
int abs(int)
Coord
#define Coord
Definition:
_defines.h:19
Extension::set_xy
void set_xy(Canvas *, Coord left, Coord bottom, Coord right, Coord top)
Definition:
math.cpp:52
Math::abs
static int abs(int)
Definition:
math.cpp:43
Canvas
#define Canvas
Definition:
_defines.h:65
left
#define left
Definition:
rbtqueue.cpp:45
right
#define right
Definition:
rbtqueue.cpp:46
geometry.h
myfabs
#define myfabs
Definition:
math.cpp:40
src
ivos
math.cpp