⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hugeint.h

📁 巨型整形实现,长度不受windows机器字长限制,实现了基本的加减乘除等运行.
💻 H
字号:
#ifndef HUGEINT_H
#define HUGEINT_H

#include "Hugeintnode.h"

class Hugeint
{
	friend istream & operator >> (istream &, Hugeint &);
	friend ostream & operator << (ostream &,  Hugeint &);
public:
	Hugeint( );
	Hugeint( const Hugeint & );
	~Hugeint();
	Hugeint  operator ++( int );
	Hugeint  operator --( int );
	Hugeint  operator + ( const long & );
	Hugeint  operator - ( const long & );
	Hugeint  operator * ( const long & );
	Hugeint  operator / ( const long & );
	Hugeint & operator ++( );
	Hugeint & operator --( );
	Hugeint & operator = ( const long & );
	Hugeint & operator = ( int );
	Hugeint & operator = ( const char * );
	Hugeint & operator = ( const Hugeint & );
	Hugeint   operator + ( const Hugeint & );
	Hugeint  operator * ( const Hugeint &);
	Hugeint  operator / ( const Hugeint & );	
	Hugeint  operator - ( const Hugeint & );
	bool  operator > ( const long & );
	bool  operator < ( const long & );
	bool  operator >= ( const long & );
	bool  operator != ( const long & );
	bool  operator == ( const long & );
	bool  operator <= ( const long & );
	bool  operator > ( const Hugeint & );
	bool  operator < ( const Hugeint & );
	bool  operator >= ( const Hugeint & );
	bool  operator <= ( const Hugeint & );
	bool  operator != ( const Hugeint & );
	bool  operator == ( const Hugeint & );

private:
	long  chu( const Hugeint &, int &);
	Hugeint  mul( int );
	Hugeint  hugeabs( const Hugeint & );
	Hugeint  div( const Hugeint & );
	Hugeint  divv( const Hugeint & );
	Hugeint  add( const Hugeint & );
	void    insertfromback( int );
	void    print( )const;
	void	insert( int );
	bool	removefirst( );
	void	setheaddata( int );
	int     getfirstdata( )const;
	bool	upfirstdata( int );
	void	makeempty( );
	int		getheaddata( )const;
	bool	isempty( )const;
	int		length()const;
	long     result;
	Hugeintnode * first;
};
#endif

⌨️ 快捷键说明

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