annotate liboctave/util/lo-ieee.h @ 22022:278fc29b69ca

maint: Eliminate unnecessary double newline blocks (only whitespace changes). * Figure.cc, annotation-dialog.cc, dialog.cc, dialog.h, files-dock-widget.cc, find-files-dialog.cc, find-files-model.cc, file-editor-tab.cc, file-editor.cc, find-dialog.cc, octave-qscintilla.cc, octave-txt-lexer.cc, main-window.cc, main-window.h, octave-cmd.cc, octave-cmd.h, octave-dock-widget.cc, octave-qt-link.cc, parser.h, webinfo.cc, settings-dialog.cc, shortcut-manager.cc, shortcut-manager.h, welcome-wizard.cc, workspace-model.cc, __ilu__.cc, __lin_interpn__.cc, besselj.cc, bsxfun.cc, cellfun.cc, conv2.cc, data.cc, debug.cc, debug.h, dynamic-ld.cc, fft2.cc, file-io.cc, ft-text-renderer.cc, gl-render.cc, gl2ps-print.cc, graphics.cc, graphics.in.h, help.cc, jit-typeinfo.cc, jit-typeinfo.h, kron.cc, ls-ascii-helper.cc, ls-hdf5.cc, ls-hdf5.h, ls-mat5.cc, max.cc, oct-map.cc, oct-map.h, oct-stream.cc, octave-link.h, pr-output.cc, pt-jit.cc, qz.cc, sparse-xdiv.cc, sparse-xpow.cc, strfind.cc, strfns.cc, symtab.h, toplev.cc, toplev.h, typecast.cc, utils.cc, variables.cc, xdiv.h, xpow.cc, xpow.h, zfstream.cc, __eigs__.cc, __init_fltk__.cc, audioread.cc, ccolamd.cc, chol.cc, qr.cc, ov-base-diag.cc, ov-base-int.cc, ov-base-sparse.cc, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool-sparse.h, ov-bool.cc, ov-bool.h, ov-builtin.h, ov-cell.cc, ov-cell.h, ov-class.cc, ov-class.h, ov-classdef.cc, ov-complex.cc, ov-complex.h, ov-cs-list.cc, ov-cs-list.h, ov-cx-diag.cc, ov-cx-diag.h, ov-cx-mat.cc, ov-cx-mat.h, ov-cx-sparse.cc, ov-cx-sparse.h, ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.h, ov-fcn-inline.h, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-complex.h, ov-flt-cx-diag.cc, ov-flt-cx-diag.h, ov-flt-cx-mat.cc, ov-flt-cx-mat.h, ov-flt-re-diag.cc, ov-flt-re-diag.h, ov-flt-re-mat.cc, ov-int16.cc, ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-intx.h, ov-lazy-idx.cc, ov-lazy-idx.h, ov-mex-fcn.h, ov-null-mat.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h, ov-re-diag.cc, ov-re-diag.h, ov-re-mat.cc, ov-re-sparse.cc, ov-re-sparse.h, ov-scalar.cc, ov-scalar.h, ov-str-mat.h, ov-struct.cc, ov-struct.h, ov-type-conv.h, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc, ov-usr-fcn.cc, ov-usr-fcn.h, ov.h, op-cm-m.cc, op-fcm-fm.cc, op-fm-fm.cc, op-int.h, op-m-m.cc, op-pm-template.cc, pt-binop.h, pt-select.cc, pt-stmt.cc, pt-unop.h, Array-util.cc, Array.cc, Array.h, CColVector.cc, CMatrix.cc, CMatrix.h, CSparse.cc, MArray.cc, MSparse.cc, MatrixType.cc, PermMatrix.cc, Range.cc, Sparse-C.cc, Sparse.cc, dMatrix.cc, dim-vector.h, fCColVector.cc, fCMatrix.cc, fMatrix.cc, fMatrix.h, idx-vector.cc, idx-vector.h, blaswrap.c, f77-fcn.h, DASPK.cc, eigs-base.cc, hess.cc, lo-specfun.cc, oct-fftw.cc, oct-norm.cc, oct-rand.cc, oct-rand.h, qr.cc, qrp.cc, randmtzig.cc, randpoisson.cc, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, Sparse-op-defs.h, mx-inlines.cc, oct-env.h, cmd-edit.cc, f2c-main.c, lo-array-errwarn.cc, lo-array-errwarn.h, lo-array-gripes.cc, lo-array-gripes.h, lo-ieee.h, lo-regexp.cc, oct-binmap.h, oct-inttypes.cc, oct-inttypes.h, oct-sort.cc, oct-sort.h, mkoctfile.in.cc: maint: Eliminate unnecessary double newline blocks (only whitespace changes).
author Rik <rik@octave.org>
date Fri, 01 Jul 2016 19:48:35 -0700
parents 11af9c03400c
children e43d83253e28
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
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19326
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
4
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
6
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
7 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
8 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: 6108
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
10 option) any later version.
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
11
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
12 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
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
14 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
15 for more details.
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
16
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
17 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: 6108
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
19 <http://www.gnu.org/licenses/>.
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
20
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
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
23 #if ! defined (octave_lo_ieee_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17744
diff changeset
24 #define octave_lo_ieee_h 1
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
25
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21066
diff changeset
26 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21066
diff changeset
27
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21723
diff changeset
28 #if defined (__cplusplus)
4072
3cc39e3b8fa5 [project @ 2002-09-27 17:54:53 by jwe]
jwe
parents: 4025
diff changeset
29 extern "C" {
3cc39e3b8fa5 [project @ 2002-09-27 17:54:53 by jwe]
jwe
parents: 4025
diff changeset
30 #endif
3cc39e3b8fa5 [project @ 2002-09-27 17:54:53 by jwe]
jwe
parents: 4025
diff changeset
31
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
32 /* Octave's idea of infinity. */
18540
89bd70fae066 fix initialization problem for Inf, NaN, and NA values (bug #41667)
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
33 #define octave_Inf (lo_ieee_inf_value ())
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
34
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
35 /* Octave's idea of a missing value. */
18540
89bd70fae066 fix initialization problem for Inf, NaN, and NA values (bug #41667)
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
36 #define octave_NA (lo_ieee_na_value ())
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
37
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
38 /* Octave's idea of not a number. */
18540
89bd70fae066 fix initialization problem for Inf, NaN, and NA values (bug #41667)
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
39 #define octave_NaN (lo_ieee_nan_value ())
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
40
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
41 /* Octave's idea of infinity. */
18540
89bd70fae066 fix initialization problem for Inf, NaN, and NA values (bug #41667)
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
42 #define octave_Float_Inf (lo_ieee_float_inf_value ())
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
43
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
44 /* Octave's idea of a missing value. */
18540
89bd70fae066 fix initialization problem for Inf, NaN, and NA values (bug #41667)
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
45 #define octave_Float_NA (lo_ieee_float_na_value ())
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
46
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
47 /* Octave's idea of not a number. */
18540
89bd70fae066 fix initialization problem for Inf, NaN, and NA values (bug #41667)
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
48 #define octave_Float_NaN (lo_ieee_float_nan_value ())
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
49
21066
258c787cd9ce maint: Use "FIXME:" consistently in code base.
Rik <rik@octave.org>
parents: 20791
diff changeset
50 /* FIXME: This code assumes that a double has twice the
258c787cd9ce maint: Use "FIXME:" consistently in code base.
Rik <rik@octave.org>
parents: 20791
diff changeset
51 number of bits as an int */
5388
7099eb9841b4 [project @ 2005-06-14 20:04:31 by jwe]
jwe
parents: 5307
diff changeset
52
4075
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
53 typedef union
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
54 {
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
55 double value;
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
56 unsigned int word[2];
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
57 } lo_ieee_double;
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
58
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
59 typedef union
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
60 {
7814
87865ed7405f Second set of single precision test code and fix of resulting bugs
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
61 float value;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
62 unsigned int word;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
63 } lo_ieee_float;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
64
7991
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
65 #define LO_IEEE_NA_HW_OLD 0x7ff00000
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
66 #define LO_IEEE_NA_LW_OLD 1954
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
67 #define LO_IEEE_NA_HW 0x7FF840F4
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
68 #define LO_IEEE_NA_LW 0x40000000
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
69 #define LO_IEEE_NA_FLOAT 0x7FC207A2
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
70
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5775
diff changeset
71 extern OCTAVE_API void octave_ieee_init (void);
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
72
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
73 extern OCTAVE_API int __lo_ieee_isnan (double x);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
74 extern OCTAVE_API int __lo_ieee_finite (double x);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
75 extern OCTAVE_API int __lo_ieee_isinf (double x);
4072
3cc39e3b8fa5 [project @ 2002-09-27 17:54:53 by jwe]
jwe
parents: 4025
diff changeset
76
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
77 extern OCTAVE_API int __lo_ieee_is_NA (double);
7991
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
78 extern OCTAVE_API int __lo_ieee_is_old_NA (double);
139f47cf17ab Change NA value to support single to double precision conversion
David Bateman <dbateman@free.fr>
parents: 7814
diff changeset
79 extern OCTAVE_API double __lo_ieee_replace_old_NA (double);
4075
9a2102864eb0 [project @ 2002-09-27 21:37:56 by jwe]
jwe
parents: 4074
diff changeset
80
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5775
diff changeset
81 extern OCTAVE_API double lo_ieee_inf_value (void);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5775
diff changeset
82 extern OCTAVE_API double lo_ieee_na_value (void);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5775
diff changeset
83 extern OCTAVE_API double lo_ieee_nan_value (void);
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4075
diff changeset
84
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
85 extern OCTAVE_API int __lo_ieee_signbit (double);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
86
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
87 extern OCTAVE_API int __lo_ieee_float_isnan (float x);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
88 extern OCTAVE_API int __lo_ieee_float_finite (float x);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
89 extern OCTAVE_API int __lo_ieee_float_isinf (float x);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
90
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
91 extern OCTAVE_API int __lo_ieee_float_is_NA (float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
92
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
93 extern OCTAVE_API float lo_ieee_float_inf_value (void);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
94 extern OCTAVE_API float lo_ieee_float_na_value (void);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
95 extern OCTAVE_API float lo_ieee_float_nan_value (void);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
96
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
97 extern OCTAVE_API int __lo_ieee_float_signbit (float);
4349
a6c22c2c9b09 [project @ 2003-02-21 18:59:07 by jwe]
jwe
parents: 4102
diff changeset
98
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21723
diff changeset
99 #if defined (__cplusplus)
4072
3cc39e3b8fa5 [project @ 2002-09-27 17:54:53 by jwe]
jwe
parents: 4025
diff changeset
100 }
2522
4f095783ee43 [project @ 1996-11-15 20:00:59 by jwe]
jwe
parents: 1993
diff changeset
101 #endif
4f095783ee43 [project @ 1996-11-15 20:00:59 by jwe]
jwe
parents: 1993
diff changeset
102
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
103 #define lo_ieee_isnan(x) (sizeof (x) == sizeof (float) ? \
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
104 __lo_ieee_float_isnan (x) : __lo_ieee_isnan (x))
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
105 #define lo_ieee_finite(x) (sizeof (x) == sizeof (float) ? \
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
106 __lo_ieee_float_finite (x) : __lo_ieee_finite (x))
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
107 #define lo_ieee_isinf(x) (sizeof (x) == sizeof (float) ? \
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
108 __lo_ieee_float_isinf (x) : __lo_ieee_isinf (x))
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
109
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
110 #define lo_ieee_is_NA(x) (sizeof (x) == sizeof (float) ? \
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
111 __lo_ieee_float_is_NA (x) : __lo_ieee_is_NA (x))
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
112 #define lo_ieee_is_NaN_or_NA(x) (sizeof (x) == sizeof (float) ? \
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
113 __lo_ieee_float_is_NaN_or_NA (x) : __lo_ieee_is_NaN_or_NA (x))
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
114 #define lo_ieee_signbit(x) (sizeof (x) == sizeof (float) ? \
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
115 __lo_ieee_float_signbit (x) : __lo_ieee_signbit (x))
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
116
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21723
diff changeset
117 #if defined (__cplusplus)
14810
d40349493d87 provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
118
21734
11af9c03400c write namespace keyword and name on same line in C++ files
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
119 namespace octave
14810
d40349493d87 provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
120 {
21723
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
121 template <typename T>
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
122 struct numeric_limits
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
123 {
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
124 static T NA (void) { return static_cast<T> (0); }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
125 static T NaN (void) { return static_cast<T> (0); }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
126 static T Inf (void) { return static_cast<T> (0); }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
127 };
14810
d40349493d87 provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
128
21723
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
129 template <>
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
130 struct numeric_limits<double>
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
131 {
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
132 static double NA (void) { return octave_NA; }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
133 static double NaN (void) { return octave_NaN; }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
134 static double Inf (void) { return octave_Inf; }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
135 };
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
136
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
137 template <>
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
138 struct numeric_limits<float>
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
139 {
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
140 static float NA (void) { return octave_Float_NA; }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
141 static float NaN (void) { return octave_Float_NaN; }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
142 static float Inf (void) { return octave_Float_Inf; }
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
143 };
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
144 }
14810
d40349493d87 provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
145
1967
4cb6aaa0f2c7 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents:
diff changeset
146 #endif
14810
d40349493d87 provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
147
d40349493d87 provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
148 #endif