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 |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
457
|
21 |
|
22 */ |
|
23 |
1296
|
24 #if defined (__GNUG__) |
|
25 #pragma implementation |
|
26 #endif |
|
27 |
457
|
28 #ifdef HAVE_CONFIG_H |
1192
|
29 #include <config.h> |
457
|
30 #endif |
|
31 |
|
32 #include <math.h> |
|
33 #include <float.h> |
|
34 |
|
35 #include "dbleDET.h" |
|
36 |
|
37 int |
|
38 DET::value_will_overflow (void) const |
|
39 { |
|
40 return det[2] + 1 > log10 (DBL_MAX) ? 1 : 0; |
|
41 } |
|
42 |
|
43 int |
|
44 DET::value_will_underflow (void) const |
|
45 { |
|
46 return det[2] - 1 < log10 (DBL_MIN) ? 1 : 0; |
|
47 } |
|
48 |
|
49 double |
|
50 DET::coefficient (void) const |
|
51 { |
|
52 return det[0]; |
|
53 } |
|
54 |
|
55 int |
|
56 DET::exponent (void) const |
|
57 { |
|
58 return (int) det[1]; |
|
59 } |
|
60 |
|
61 double |
|
62 DET::value (void) const |
|
63 { |
|
64 return det[0] * pow (10.0, det[1]); |
|
65 } |
|
66 |
|
67 /* |
|
68 ;;; Local Variables: *** |
|
69 ;;; mode: C++ *** |
|
70 ;;; page-delimiter: "^/\\*" *** |
|
71 ;;; End: *** |
|
72 */ |