Mercurial > octave
annotate liboctave/util/lo-ieee.h @ 30394:f3f3e3793fb5 stable
maint: style check C++ files in liboctave/ ahead of 7.1 release.
* Array.cc, Array.h, CMatrix.cc, CSparse.cc, MArray.cc, MSparse.cc,
MatrixType.cc, MatrixType.h, Range.cc, Range.h, Sparse.cc, Sparse.h,
dMatrix.cc, dSparse.cc, fCMatrix.cc, fCMatrix.h, fMatrix.cc, fMatrix.h,
idx-vector.cc, idx-vector.h, CollocWt.cc, CollocWt.h, DASPK.cc, DASRT.cc,
DASSL.cc, EIG.cc, LSODE.cc, Quad.cc, aepbalance.cc, chol.cc, eigs-base.cc,
gepbalance.cc, gsvd.cc, lo-amos-proto.h, lo-arpack-proto.h, lo-blas-proto.h,
lo-lapack-proto.h, lo-qrupdate-proto.h, lo-specfun.cc, oct-convn.h, oct-fftw.h,
oct-norm.cc, oct-spparms.cc, randmtzig.cc, sparse-chol.cc, sparse-dmsolve.cc,
sparse-lu.cc, sparse-qr.cc, sparse-qr.h, svd.cc, file-ops.cc, file-stat.cc,
lo-sysinfo.cc, oct-env.cc, f77-fcn.h, lo-cutils.h, lo-ieee.h, lo-regexp.cc,
lo-utils.cc, oct-binmap.h, oct-inttypes.h, oct-sparse.cc, oct-sparse.h,
oct-string.cc, url-transfer.cc:
Style check C++ files in liboctave/ ahead of 7.1 release.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 29 Nov 2021 10:03:47 -0800 |
parents | 603a83d18107 |
children | 796f54d4ddbf |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
3 // Copyright (C) 1996-2021 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
1967 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #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
|
27 #define octave_lo_ieee_h 1 |
1967 | 28 |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
29 #include <cmath> |
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
30 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21066
diff
changeset
|
31 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21066
diff
changeset
|
32 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21723
diff
changeset
|
33 #if defined (__cplusplus) |
4072 | 34 extern "C" { |
35 #endif | |
36 | |
4102 | 37 /* 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
|
38 #define octave_Inf (lo_ieee_inf_value ()) |
4102 | 39 |
40 /* 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
|
41 #define octave_NA (lo_ieee_na_value ()) |
4102 | 42 |
43 /* 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
|
44 #define octave_NaN (lo_ieee_nan_value ()) |
4102 | 45 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
46 /* 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
|
47 #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
|
48 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
49 /* 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
|
50 #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
|
51 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
52 /* 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
|
53 #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
|
54 |
21066
258c787cd9ce
maint: Use "FIXME:" consistently in code base.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
55 /* 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
|
56 number of bits as an int */ |
5388 | 57 |
30185
603a83d18107
maint: Backed out changeset 0cd93ca0b237
Rik <rik@octave.org>
parents:
30176
diff
changeset
|
58 typedef union |
30394
f3f3e3793fb5
maint: style check C++ files in liboctave/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30185
diff
changeset
|
59 { |
4075 | 60 double value; |
61 unsigned int word[2]; | |
30185
603a83d18107
maint: Backed out changeset 0cd93ca0b237
Rik <rik@octave.org>
parents:
30176
diff
changeset
|
62 } lo_ieee_double; |
4075 | 63 |
30185
603a83d18107
maint: Backed out changeset 0cd93ca0b237
Rik <rik@octave.org>
parents:
30176
diff
changeset
|
64 typedef union |
30394
f3f3e3793fb5
maint: style check C++ files in liboctave/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30185
diff
changeset
|
65 { |
7814
87865ed7405f
Second set of single precision test code and fix of resulting bugs
David Bateman <dbateman@free.fr>
parents:
7789
diff
changeset
|
66 float value; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
67 unsigned int word; |
30185
603a83d18107
maint: Backed out changeset 0cd93ca0b237
Rik <rik@octave.org>
parents:
30176
diff
changeset
|
68 } lo_ieee_float; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
69 |
6108 | 70 extern OCTAVE_API void octave_ieee_init (void); |
1967 | 71 |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
72 inline int __lo_ieee_isnan (double x) { return std::isnan (x); } |
30088
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
73 inline int __lo_ieee_isfinite (double x) { return std::isfinite (x); } |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
74 inline int __lo_ieee_isinf (double x) { return std::isinf (x); } |
4072 | 75 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
76 extern OCTAVE_API int __lo_ieee_is_NA (double); |
4075 | 77 |
6108 | 78 extern OCTAVE_API double lo_ieee_inf_value (void); |
79 extern OCTAVE_API double lo_ieee_na_value (void); | |
80 extern OCTAVE_API double lo_ieee_nan_value (void); | |
4102 | 81 |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
82 inline int __lo_ieee_signbit (double x) { return std::signbit (x); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
83 |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
84 inline int __lo_ieee_float_isnan (float x) { return std::isnan (x); } |
30088
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
85 inline int __lo_ieee_float_isfinite (float x) { return std::isfinite (x); } |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
86 inline int __lo_ieee_float_isinf (float x) { return std::isinf (x); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
87 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
88 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
|
89 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
90 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
|
91 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
|
92 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
|
93 |
23622
0abe8d85ecce
Use isnan, isinf, isfinite, signbit functions from C++ std lib.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
94 inline int __lo_ieee_float_signbit (float x) { return std::signbit (x); } |
4349 | 95 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21723
diff
changeset
|
96 #if defined (__cplusplus) |
4072 | 97 } |
2522 | 98 #endif |
99 | |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
100 #define lo_ieee_isnan(x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
101 (sizeof (x) == sizeof (float) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
102 ? __lo_ieee_float_isnan (x) : __lo_ieee_isnan (x)) |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
103 |
30088
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
104 #define lo_ieee_isfinite(x) \ |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
105 (sizeof (x) == sizeof (float) \ |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
106 ? __lo_ieee_float_isfinite (x) : __lo_ieee_isfinite (x)) |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
107 |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
108 #define lo_ieee_isinf(x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
109 (sizeof (x) == sizeof (float) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
110 ? __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
|
111 |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
112 #define lo_ieee_is_NA(x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
113 (sizeof (x) == sizeof (float) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
114 ? __lo_ieee_float_is_NA (x) : __lo_ieee_is_NA (x)) |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
115 |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
116 #define lo_ieee_is_NaN_or_NA(x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
117 (sizeof (x) == sizeof (float) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
118 ? __lo_ieee_float_is_NaN_or_NA (x) : __lo_ieee_is_NaN_or_NA (x)) |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
119 |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
120 #define lo_ieee_signbit(x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
121 (sizeof (x) == sizeof (float) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
122 ? __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
|
123 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21723
diff
changeset
|
124 #if defined (__cplusplus) |
14810
d40349493d87
provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
125 |
21734
11af9c03400c
write namespace keyword and name on same line in C++ files
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
126 namespace octave |
14810
d40349493d87
provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
127 { |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
128 template <typename T> |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
129 struct numeric_limits |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
130 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
30088
diff
changeset
|
131 public: |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
132 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
|
133 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
|
134 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
|
135 }; |
14810
d40349493d87
provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
136 |
21723
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<double> |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
139 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
30088
diff
changeset
|
140 public: |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
141 static double NA (void) { return octave_NA; } |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
142 static double NaN (void) { return octave_NaN; } |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
143 static double Inf (void) { return octave_Inf; } |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
144 }; |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
145 |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
146 template <> |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
147 struct numeric_limits<float> |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
148 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
30088
diff
changeset
|
149 public: |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
150 static float NA (void) { return octave_Float_NA; } |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
151 static float NaN (void) { return octave_Float_NaN; } |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
152 static float Inf (void) { return octave_Float_Inf; } |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
153 }; |
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
154 } |
14810
d40349493d87
provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
155 |
1967 | 156 #endif |
14810
d40349493d87
provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
157 |
30088
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
158 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
159 |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
160 OCTAVE_DEPRECATED (7, "use '__lo_ieee_isfinite' instead") |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
161 inline int __lo_ieee_finite (double x) { return __lo_ieee_isfinite (x); } |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
162 |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
163 OCTAVE_DEPRECATED (7, "use '__lo_ieee_float_isfinite' instead") |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
164 inline int __lo_ieee_float_finite (float x) |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
165 { return __lo_ieee_float_isfinite (x); } |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
166 |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
167 #define lo_ieee_finite(x) lo_ieee_isfinite(x) |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
168 |
14810
d40349493d87
provide template version of octave_NA
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
169 #endif |
30088
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
170 |
fca57eaad2d4
maint: deprecate lo_ieee_finite and replace with lo_ieee_isfinite.
Rik <rik@octave.org>
parents:
29986
diff
changeset
|
171 #endif |