hugeint.h

来自「巨型整形实现,长度不受windows机器字长限制,实现了基本的加减乘除等运行.」· C头文件 代码 · 共 64 行

H
64
字号
#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 & );
	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 + =
减小字号Ctrl + -
显示快捷键?