You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iAlg/iAlgMath/zxHugeNum.h

46 lines
1.1 KiB
C

#pragma once
#include "iAlgMath_global.h"
// 定义大数
class I_ALGMATH_EXPORT zxHugeNum
{
public:
zxHugeNum();
zxHugeNum(double dM, double dI = 0);
zxHugeNum(const zxHugeNum& other);
~zxHugeNum();
bool operator == (const zxHugeNum &other) const;
bool operator != (const zxHugeNum &other) const;
zxHugeNum operator = (const zxHugeNum& other);
zxHugeNum operator + (const zxHugeNum& other);
zxHugeNum operator - (const zxHugeNum& other);
zxHugeNum operator * (const zxHugeNum& other);
zxHugeNum operator / (const zxHugeNum& other);
zxHugeNum operator + (const double& d);
zxHugeNum operator - (const double& d);
zxHugeNum operator * (const double& d);
zxHugeNum operator / (const double& d);
public:
double index() { return m_dIndex; }
double multipler() { return m_dMultipler; }
double total() { return m_dTotal; }
bool isZero();
private:
void makesureTotal();
private:
double m_dIndex; //exp的次数
double m_dMultipler;//乘数
double m_dTotal; //合起来是 exp(m_dIndex) * m_dMultipler;
};