Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IEEE_754_unions.h
Go to the documentation of this file.
1 
2 // ======================================================================
3 //
4 // Copyright (c) 1999 The CGAL Consortium
5 
6 // This software and related documentation is part of the Computational
7 // Geometry Algorithms Library (CGAL).
8 // This software and documentation is provided "as-is" and without warranty
9 // of any kind. In no event shall the CGAL Consortium be liable for any
10 // damage of any kind.
11 //
12 // Every use of CGAL requires a license.
13 //
14 // Academic research and teaching license
15 // - For academic research and teaching purposes, permission to use and copy
16 // the software and its documentation is hereby granted free of charge,
17 // provided that it is not a component of a commercial product, and this
18 // notice appears in all copies of the software and related documentation.
19 //
20 // Commercial licenses
21 // - A commercial license is available through Algorithmic Solutions, who also
22 // markets LEDA (http://www.algorithmic-solutions.de).
23 // - Commercial users may apply for an evaluation license by writing to
24 // Algorithmic Solutions (contact@algorithmic-solutions.com).
25 //
26 // The CGAL Consortium consists of Utrecht University (The Netherlands),
27 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
28 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
29 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
30 // and Tel-Aviv University (Israel).
31 //
32 // ----------------------------------------------------------------------
33 //
34 // release : CGAL-2.2
35 // release_date : 2000, September 30
36 //
37 // source : IEEE.fw
38 // file : include/CGAL/IEEE_754_unions.h
39 // package : Number_types (3.4)
40 // revision : 3.4
41 // revision_date : 13 Jul 2000
42 // author(s) : Stefan Schirra
43 //
44 //
45 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
46 // email : contact@cgal.org
47 // www : http://www.cgal.org
48 //
49 // ======================================================================
50 
51 
52 #include <iomanip>
53 
54 #ifndef CGAL_IEEE_754_UNIONS_H
55 #define CGAL_IEEE_754_UNIONS_H
56 
57 
59 {
60  double a;
61 #ifdef CGAL_BIG_ENDIAN
62  struct { unsigned sign : 1;
63  unsigned exp :11;
64  unsigned high :20;
65  unsigned low :32;
66  } b;
67  struct { unsigned H :32;
68  unsigned L :32;
69  } c;
70 #else
71  struct { unsigned low :32;
72  unsigned sign : 1;
73  unsigned exp :11;
74  unsigned high :20;
75  } b;
76  struct { unsigned L :32;
77  unsigned H :32;
78  } c;
79 #endif
80 };
81 
83 {
84  float a;
85  struct { unsigned sign : 1;
86  unsigned exp : 8;
87  unsigned high :23;
88  } b;
89  unsigned c;
90 };
91 
92 inline
93 void
95 {
96  std::cout << std::endl;
97  std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.H;
98  std::cout << ' ';
99  std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.L;
100  std::cout << std::endl;
101 }
102 
103 inline
104 void
106 {
107  std::cout << std::endl;
108  std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c;
109  std::cout << std::endl;
110 }
111 
112 
113 
114 #endif // CGAL_IEEE_754_UNIONS_H
void show(IEEE_754_double *p)
struct IEEE_754_double::@31 b
struct IEEE_754_double::@32 c
struct IEEE_754_float::@33 b