00001 // ################################################################## 00002 // Binx 00003 // $Id: BxQuadruple128_8h-source.html,v 1.1.1.1 2006/04/19 14:19:02 edikt2 Exp $ 00004 // 00005 // Class for 128-bit floating point numbers. 00006 // ################################################################## 00007 /* 00008 00009 // edikt::BinX 00010 // www.edikt.org 00011 // support@edikt.org 00012 00013 // Copyright (c) 2003 The University of Edinburgh. 00014 00015 */ 00016 00017 #ifndef __BxQuadruple128__ 00018 #define __BxQuadruple128__ 00019 00020 #include "BxFloat.h" 00021 00022 /* 00023 * Class implementing the BinX data type 128-bit floating point numbers. 00024 * Instances of this class hold and perform operations on the BinX XML Schema 00025 * type <quadruple-128>. 00026 * <BR>The implementation of quadruple precision floating point operations 00027 * is highly and compiler platform dependent. 00028 * On little endian system (such as processors designed by Intel Corporation) 00029 * quadruple precision is supported as follows: 00030 * <UL> 00031 * <li>The GNU C language Compiler uses 96-bit extended floating point numbers</li> 00032 * <li>The Borland C language Compiler uses 80-bit extended floating point numbers</li> 00033 * </UL> 00034 * On big endian systems (such processors desgined by Sun Microsystems) 00035 * quadruple precision is supported as follows: 00036 * <UL> 00037 * <li>Under the operating system SunOS, the GNU C language Compiler 00038 * uses 128-bit floating point numbers</li> 00039 * </UL> 00040 * <BR>Machines that support extended floating point number formats 00041 * may support 80-bit extensions, 96-bit extensions, or 128-bit extensions. 00042 * BinX defines all of these as primitive data types, 00043 * but individual platforms will support only a subset of these data types. 00044 * This can result in incompatibilities between floating point numbers 00045 * contained in binary data files written by one machine 00046 * and the ability to properly process those values on another machine. 00047 * The BinX library implements methods for converting between floating point numbers 00048 * having 80-bit and 96-bit precision. 00049 * The BinX library does <B>not</B> implement methods for converting between 00050 * 128-bit precision and 80-bit or 96-bit precision. 00051 * <BR>It is possible for a binary data file to contain 00052 * quadruple precision floating point numbers 00053 * and the target host machine does not support quadruple precision. 00054 * When attempting to read these 128-bit floating point values, 00055 * the BinX library returns raises an error condition and returns the value zero. 00056 * <BR>This class also implements methods to: 00057 * <UL> 00058 * <li>Serialize a floating point value to a file stream</li> 00059 * <li>Parse and store an individual floating point value from a file or a stream buffer</li> 00060 * </UL> 00061 * <BR><B>Implementation Notes:</B><BR> 00062 * BinX implements quadruple floating point numbers 00063 * using the C-language type "long double". 00064 * <BR><B>Since:</B> BinX version 1.0. 00065 */ 00066 class DECLSPEC BxQuadruple128 : public BxFloat 00067 { 00068 public: 00069 BxQuadruple128(); 00070 BxQuadruple128(const bx_quadruple128); 00071 BxQuadruple128(const BxQuadruple128& copy); 00072 virtual ~BxQuadruple128(); 00073 00074 virtual char* className() const { return "BxQuadruple128"; } //<Returns the null-terminated string "BxQuadruple128". 00075 virtual BxQuadruple128* clone() const; 00076 virtual void print(); 00077 virtual bool equals(const BxDataObject&) const; 00078 virtual char * toString(bool xml); //new a string for the value 00079 virtual bool parseValue(const char *); 00080 virtual bool readFromFile(); 00081 virtual void readFromBuffer(const byte *); //read data from a buffer 00082 00083 BxQuadruple128& operator=(const bx_quadruple128); 00084 }; 00085 00086 #endif
1.3.3