comparison liboctave/util/lo-ieee.h @ 30176:0cd93ca0b237

maint: lo-ieee.h: Use C++ named union declaration rather than C-style typedef. * lo-ieee.h: Use C++ named union declaration for "lo_ieee_double" and "lo_ieee_float".
author Rik <rik@octave.org>
date Tue, 14 Sep 2021 16:59:56 -0700
parents 14b098a6ba46
children 603a83d18107
comparison
equal deleted inserted replaced
30175:b063bc05be18 30176:0cd93ca0b237
53 #define octave_Float_NaN (lo_ieee_float_nan_value ()) 53 #define octave_Float_NaN (lo_ieee_float_nan_value ())
54 54
55 /* FIXME: This code assumes that a double has twice the 55 /* FIXME: This code assumes that a double has twice the
56 number of bits as an int */ 56 number of bits as an int */
57 57
58 typedef union 58 union lo_ieee_double
59 { 59 {
60 double value; 60 double value;
61 unsigned int word[2]; 61 unsigned int word[2];
62 } lo_ieee_double; 62 };
63 63
64 typedef union 64 union lo_ieee_float
65 { 65 {
66 float value; 66 float value;
67 unsigned int word; 67 unsigned int word;
68 } lo_ieee_float; 68 };
69 69
70 extern OCTAVE_API void octave_ieee_init (void); 70 extern OCTAVE_API void octave_ieee_init (void);
71 71
72 inline int __lo_ieee_isnan (double x) { return std::isnan (x); } 72 inline int __lo_ieee_isnan (double x) { return std::isnan (x); }
73 inline int __lo_ieee_isfinite (double x) { return std::isfinite (x); } 73 inline int __lo_ieee_isfinite (double x) { return std::isfinite (x); }