457
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
457
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
1192
|
25 #include <config.h> |
457
|
26 #endif |
|
27 |
|
28 #include <math.h> |
|
29 #include <float.h> |
|
30 |
|
31 #include <Complex.h> |
|
32 |
|
33 #include "CmplxDET.h" |
|
34 |
|
35 int |
|
36 ComplexDET::value_will_overflow (void) const |
|
37 { |
|
38 return det[2].real () + 1 > log10 (DBL_MAX) ? 1 : 0; |
|
39 } |
|
40 |
|
41 int |
|
42 ComplexDET::value_will_underflow (void) const |
|
43 { |
|
44 return det[2].real () - 1 < log10 (DBL_MIN) ? 1 : 0; |
|
45 } |
|
46 |
|
47 Complex |
|
48 ComplexDET::coefficient (void) const |
|
49 { |
|
50 return det[0]; |
|
51 } |
|
52 |
|
53 int |
|
54 ComplexDET::exponent (void) const |
|
55 { |
|
56 return (int) (det[1].real ()); |
|
57 } |
|
58 |
|
59 Complex |
|
60 ComplexDET::value (void) const |
|
61 { |
|
62 return det[0] * pow (10.0, det[1].real ()); |
|
63 } |
|
64 |
|
65 /* |
|
66 ;;; Local Variables: *** |
|
67 ;;; mode: C++ *** |
|
68 ;;; page-delimiter: "^/\\*" *** |
|
69 ;;; End: *** |
|
70 */ |