extreal.h

来自「此程序为wcdma系统当中ftp/video业务模型的c++程序仿真 通过此程序」· C头文件 代码 · 共 43 行

H
43
字号

// extreal.h ----------------------------------------------------------
#include <iostream.h>

#ifndef EXTREAL_LIB
#define EXTREAL_LIB 0

#ifdef use_namespace
namespace NEWRAN { using namespace RBD_COMMON; }
namespace RBD_LIBRARIES { using namespace NEWRAN; }
namespace NEWRAN {
#endif

/************************ extended real class ***************************/

enum EXT_REAL_CODE
   { Finite, PlusInfinity, MinusInfinity, Indefinite, Missing };

class ExtReal
{
   Real value;
   EXT_REAL_CODE c;
public:
   ExtReal operator+(const ExtReal&) const;
   ExtReal operator-(const ExtReal&) const;
   ExtReal operator*(const ExtReal&) const;
   ExtReal operator-() const;
   friend ostream& operator<<( ostream&, const ExtReal& );
   ExtReal(Real v) { c=Finite; value=v; }
   ExtReal(const EXT_REAL_CODE& cx) { c = cx; }
   ExtReal() { c = Missing; }
   Real Value() const { return value; }
   bool IsReal() const { return c==Finite; }
   EXT_REAL_CODE Code() const { return c; }
};

#ifdef use_namespace
}
#endif


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?