annotate liboctave/lo-ieee.cc @ 10454:79a56d0a6a0d ss-3-3-51

version is now 3.3.51
author John W. Eaton <jwe@octave.org>
date Wed, 24 Mar 2010 16:27:05 -0400
parents 07ebe522dac2
children 2f36145742c9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
1 /*
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005,
9592
5828d64ca004 lo-ieee.cc: include cstdlib, update copyright date
John W. Eaton <jwe@octave.org>
parents: 9591
diff changeset
4 2007, 2008, 2009 John W. Eaton
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
5
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
7
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
11 option) any later version.
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
12
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
16 for more details.
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
17
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
20 <http://www.gnu.org/licenses/>.
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
21
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
22 */
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
23
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
25 #include <config.h>
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
26 #endif
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
27
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
28 #include <cfloat>
9592
5828d64ca004 lo-ieee.cc: include cstdlib, update copyright date
John W. Eaton <jwe@octave.org>
parents: 9591
diff changeset
29 #include <cstdlib>
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
30
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
31 #if defined (HAVE_FLOATINGPOINT_H)
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
32 #include <floatingpoint.h>
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
33 #endif
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
34
3268
fdc7dd08cd85 [project @ 1999-09-10 05:16:49 by jwe]
jwe
parents: 3238
diff changeset
35 #if defined (HAVE_IEEEFP_H)
fdc7dd08cd85 [project @ 1999-09-10 05:16:49 by jwe]
jwe
parents: 3238
diff changeset
36 #include <ieeefp.h>
fdc7dd08cd85 [project @ 1999-09-10 05:16:49 by jwe]
jwe
parents: 3238
diff changeset
37 #endif
fdc7dd08cd85 [project @ 1999-09-10 05:16:49 by jwe]
jwe
parents: 3238
diff changeset
38
2598
36a4daa9e3c7 [project @ 1996-12-19 02:27:21 by jwe]
jwe
parents: 2560
diff changeset
39 #if defined (HAVE_NAN_H)
36a4daa9e3c7 [project @ 1996-12-19 02:27:21 by jwe]
jwe
parents: 2560
diff changeset
40 #if defined (SCO)
2560
6fa1ac46c980 [project @ 1996-12-03 17:49:38 by jwe]
jwe
parents: 2508
diff changeset
41 #define _IEEE 1
2598
36a4daa9e3c7 [project @ 1996-12-19 02:27:21 by jwe]
jwe
parents: 2560
diff changeset
42 #endif
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 1993
diff changeset
43 #include <nan.h>
2598
36a4daa9e3c7 [project @ 1996-12-19 02:27:21 by jwe]
jwe
parents: 2560
diff changeset
44 #if defined (SCO)
2560
6fa1ac46c980 [project @ 1996-12-03 17:49:38 by jwe]
jwe
parents: 2508
diff changeset
45 #undef _IEEE
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 1993
diff changeset
46 #endif
2598
36a4daa9e3c7 [project @ 1996-12-19 02:27:21 by jwe]
jwe
parents: 2560
diff changeset
47 #endif
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 1993
diff changeset
48
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
49 #include "lo-error.h"
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
50 #include "lo-ieee.h"
7231
2eb392d058bb [project @ 2007-11-30 18:53:29 by jwe]
jwe
parents: 7017
diff changeset
51 #include "lo-math.h"
4025
cfb762dc9259 [project @ 2002-08-09 06:32:15 by jwe]
jwe
parents: 3475
diff changeset
52 #include "mach-info.h"
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
53
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
54 void
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
55 octave_ieee_init (void)
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
56 {
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
57 // Default values. DBL_MAX is not right for NaN and NA, but do you
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
58 // have a better suggestion? If you don't have IEEE floating point
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
59 // values, there are many parts of Octave that will not work
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
60 // correctly.
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
61
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
62 octave_Inf = octave_NaN = octave_NA = DBL_MAX;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
63 octave_Float_Inf = octave_Float_NaN = octave_Float_NA = FLT_MAX;
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
64
4601
1ed6cfbc8ea4 [project @ 2003-11-12 18:30:29 by jwe]
jwe
parents: 4574
diff changeset
65 oct_mach_info::float_format ff = oct_mach_info::native_float_format ();
1ed6cfbc8ea4 [project @ 2003-11-12 18:30:29 by jwe]
jwe
parents: 4574
diff changeset
66
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
67 switch (ff)
4601
1ed6cfbc8ea4 [project @ 2003-11-12 18:30:29 by jwe]
jwe
parents: 4574
diff changeset
68 {
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
69 case oct_mach_info::flt_fmt_ieee_big_endian:
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
70 case oct_mach_info::flt_fmt_ieee_little_endian:
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
71 {
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
72 // Don't optimize away tmp_inf / tmp_inf to generate octave_NaN.
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
73
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
74 volatile double tmp_inf;
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
75
2713
eb99ed3112d9 [project @ 1997-02-21 22:34:50 by jwe]
jwe
parents: 2702
diff changeset
76 #if defined (SCO)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
77 volatile double tmp = 1.0;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
78 tmp_inf = 1.0 / (tmp - tmp);
4164
67ef87a80c49 [project @ 2002-11-11 18:10:44 by jwe]
jwe
parents: 4102
diff changeset
79 #elif defined (__alpha__) && defined (__osf__)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
80 extern unsigned int DINFINITY[2];
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
81 tmp_inf = (*(X_CAST(double *, DINFINITY)));
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
82 #else
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
83 double tmp = 1e+10;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
84 tmp_inf = tmp;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
85 for (;;)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
86 {
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
87 tmp_inf *= 1e+10;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
88 if (tmp_inf == tmp)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
89 break;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
90 tmp = tmp_inf;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
91 }
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
92 #endif
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
93
4164
67ef87a80c49 [project @ 2002-11-11 18:10:44 by jwe]
jwe
parents: 4102
diff changeset
94 #if defined (__alpha__) && defined (__osf__)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
95 extern unsigned int DQNAN[2];
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
96 octave_NaN = (*(X_CAST(double *, DQNAN)));
9441
160c564d5d25 initialize floating point values properly for NetBSD systems
Aleksej Saushev <asau@inbox.ru>
parents: 8920
diff changeset
97 #elif defined (__NetBSD__)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
98 octave_NaN = nan ("");
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
99 #else
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
100 octave_NaN = tmp_inf / tmp_inf;
8029
090001c04619 initialization check for correct NaN sign
Jaroslav Hajek <highegg@gmail.com>
parents: 7814
diff changeset
101 // try to ensure that lo_ieee_sign gives false for a NaN.
090001c04619 initialization check for correct NaN sign
Jaroslav Hajek <highegg@gmail.com>
parents: 7814
diff changeset
102 if (lo_ieee_signbit (octave_NaN))
090001c04619 initialization check for correct NaN sign
Jaroslav Hajek <highegg@gmail.com>
parents: 7814
diff changeset
103 octave_NaN = -octave_NaN;
090001c04619 initialization check for correct NaN sign
Jaroslav Hajek <highegg@gmail.com>
parents: 7814
diff changeset
104
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
105 #endif
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
106
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
107 octave_Inf = tmp_inf;
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
108
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
109 // This is patterned after code in R.
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
110
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
111 if (ff == oct_mach_info::flt_fmt_ieee_big_endian)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
112 {
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
113 lo_ieee_hw = 0;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
114 lo_ieee_lw = 1;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
115 }
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
116 else
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
117 {
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
118 lo_ieee_hw = 1;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
119 lo_ieee_lw = 0;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
120 }
4025
cfb762dc9259 [project @ 2002-08-09 06:32:15 by jwe]
jwe
parents: 3475
diff changeset
121
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
122 lo_ieee_double t;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
123 t.word[lo_ieee_hw] = LO_IEEE_NA_HW;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
124 t.word[lo_ieee_lw] = LO_IEEE_NA_LW;
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
125
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
126 octave_NA = t.value;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
127
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
128 volatile float float_tmp_inf;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
129
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
130 #if defined (SCO)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
131 volatile float float_tmp = 1.0;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
132 float_tmp_inf = 1.0 / (float_tmp - float_tmp);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
133 #else
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
134 float float_tmp = 1e+10;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
135 float_tmp_inf = float_tmp;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
136 for (;;)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
137 {
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
138 float_tmp_inf *= 1e+10;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
139 if (float_tmp_inf == float_tmp)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
140 break;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
141 float_tmp = float_tmp_inf;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
142 }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
143 #endif
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7231
diff changeset
144
9441
160c564d5d25 initialize floating point values properly for NetBSD systems
Aleksej Saushev <asau@inbox.ru>
parents: 8920
diff changeset
145 #if defined (__NetBSD__)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
146 octave_Float_NaN = nanf ("");
9441
160c564d5d25 initialize floating point values properly for NetBSD systems
Aleksej Saushev <asau@inbox.ru>
parents: 8920
diff changeset
147 #else
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
148 octave_Float_NaN = float_tmp_inf / float_tmp_inf;
9441
160c564d5d25 initialize floating point values properly for NetBSD systems
Aleksej Saushev <asau@inbox.ru>
parents: 8920
diff changeset
149 #endif
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
150 octave_Float_Inf = float_tmp_inf;
7814
87865ed7405f Second set of single precision test code and fix of resulting bugs
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
151
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
152 lo_ieee_float tf;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
153 tf.word = LO_IEEE_NA_FLOAT;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
154 octave_Float_NA = tf.value;
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
155 }
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
156 break;
4025
cfb762dc9259 [project @ 2002-08-09 06:32:15 by jwe]
jwe
parents: 3475
diff changeset
157
4698
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
158 case oct_mach_info::flt_fmt_cray:
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
159 case oct_mach_info::flt_fmt_vax_d:
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
160 case oct_mach_info::flt_fmt_vax_g:
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
161 default:
737fd5c0ae06 [project @ 2004-01-19 19:25:26 by jwe]
jwe
parents: 4603
diff changeset
162 // If the format is unknown, then you will probably not have a
9805
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9592
diff changeset
163 // useful system, so we will abort here. Anyone wishing to
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9592
diff changeset
164 // experiment with building Octave on a system without IEEE
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9592
diff changeset
165 // floating point should be capable of removing this check and
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9592
diff changeset
166 // the configure test.
9591
264fb5520973 abort if floating point format is not recognized as IEEE
John W. Eaton <jwe@octave.org>
parents: 9441
diff changeset
167 (*current_liboctave_error_handler)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
168 ("lo_ieee_init: floating point format is not IEEE! Maybe DLAMCH is miscompiled, or you are using some strange system without IEEE floating point math?");
9591
264fb5520973 abort if floating point format is not recognized as IEEE
John W. Eaton <jwe@octave.org>
parents: 9441
diff changeset
169 abort ();
4601
1ed6cfbc8ea4 [project @ 2003-11-12 18:30:29 by jwe]
jwe
parents: 4574
diff changeset
170 }
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
171 }