C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: rts_real.hpp,v 1.24 2014/01/30 17:23:48 cxsc Exp $ */ 00025 00026 00027 #ifndef _CXSC_RTS_REAL_HPP_INCLUDED 00028 #define _CXSC_RTS_REAL_HPP_INCLUDED 00029 00030 /* Deklarationen der Funktionen des Laufzeitsystems, die fuer die 00031 gerichtete Rundung der Klasse "real" benoetigt werden, und 00032 Definition dazu benoetigter Konvertierungsoperatoren. 00033 (Declaration of functions of the runtime system, used for the 00034 directed rounding in the class "real", and definitions of needed 00035 conversion operators.) 00036 */ 00037 00038 // Deklaration von Hilfsfunktionen des Laufzeitsystems 00039 // Der Typ a_real ist in p88rts.h des Laufzeitsystems als 64-Bit-Zahl definiert 00040 // (Help functions of the runtime system declarated here) 00041 00042 #include "RtsTyp.h" 00043 00044 namespace cxsc { 00045 00046 // Verknuepfungen mit Rundung nach oben bzw. unten 00047 // (Operators with rounding upwards or downwards) 00048 extern "C" { 00049 #if ( OPT80387 ) 00050 a_real r_addd80387 (a_real a, a_real b); // speziell fuer 80387-Koprozessor 00051 a_real r_addu80387 (a_real a, a_real b); // (especially for 80387) 00052 a_real r_subd80387 (a_real a, a_real b); 00053 a_real r_subu80387 (a_real a, a_real b); 00054 a_real r_muld80387 (a_real a, a_real b); 00055 a_real r_mulu80387 (a_real a, a_real b); 00056 a_real r_divd80387 (a_real a, a_real b); 00057 a_real r_divu80387 (a_real a, a_real b); 00058 #else 00059 a_real r_addd (a_real a, a_real b); 00060 a_real r_addu (a_real a, a_real b); 00061 a_real r_subd (a_real a, a_real b); 00062 a_real r_subu (a_real a, a_real b); 00063 a_real r_muld (a_real a, a_real b); 00064 a_real r_mulu (a_real a, a_real b); 00065 a_real r_divd (a_real a, a_real b); 00066 a_real r_divu (a_real a, a_real b); 00067 #endif 00068 00069 #if HP_9000_CPP+SUN4_CPP_C 00070 void r_lfsr(); 00071 #endif 00072 } 00073 00074 // namespace real 00075 //{ 00076 00077 // Operatoren fuer Umwandlungen zwischen real und a_real 00078 // (operators for conversions between real and a_real) 00079 00080 class real; 00081 00082 inline a_real _a_real(const real &x) 00083 { return *((const a_real *)(&x)); 00084 } 00085 00086 // As a_real are doubles this is defined in real.hpp 00087 // inline real _real(const a_real &x) 00088 // { return *((const real *)(&x)); 00089 // } 00090 00091 //} // namespace real 00092 00093 } // namespace cxsc 00094 00095 #endif // _CXSC_RTS_REAL_HPP_INCLUDED 00096