Tải bản đầy đủ - 0 (trang)
B.2 Input/Output, Conversion, Comparison: Friend Functions

B.2 Input/Output, Conversion, Comparison: Friend Functions

Tải bản đầy đủ - 0trang

B.2Input/Output,Conversion,Comparison:

FriendFunctions

constint

operator==(constLINT&a,

testa==b

constLINT&b);

constint

operator!=(constLINT&a

constLINT&b);

constint

operator<(constLINT&a,

constLINT&b);

constint

operator>(constLINT&a,

constLINT&b);



testa!=b



comparisona


comparisona>b



constint

operator<=(constLINT&a,

comparisona<=b

constLINT&b);

constint

operator>=(constLINT&a,

comparisona>=b

constLINT&b);

void

fswap(LINT&a,LINT&b);



exchangeofaandb



void

purge(LINT&a);



clearbyoverwriting



char*



lint2str(constLINT&a,

constUSHORTbase,

constintshowbase);



UCHAR*

lint2byte(constLINT&a,

int*len);



representationofaascharacter

stringtobasebase,withprefix

0x,or0bifshowbase>0

transformationofaintoabyte

vector,outputoflengthinlen,

accordingtoIEEEP1363,

significanceofbytesincreasing

fromlefttoright



ostream&

LintHex(ostream&s);



ostreammanipulatorforhex

representationofLINTintegers



ostream&

LintDec(ostream&s);



ostreammanipulatorfordecimal

representationofLINTintegers



ostream&

LintShowbase(ostream&s);



ostream&

LintNobase(ostream&s);



ostreammanipulatorforthe

displayofaprefix0x(resp.0b)

inhex(resp.binary)

representationofLINTintegers

ostreammanipulatorfor

omissionofaprefix0xor0bin

hexorbinaryrepresentationof

LINTintegers



ostreammanipulatorfordisplay

ostream&

LintShowlength(ostream&s); ofthebinarylengthintheoutput

ofLINTintegers

ostream&

LintNolength(ostream&s);



manipulatorfortheomissionof

binarylengthintheoutputLINT

integers



LINT_omanip

SetLintFlags(intflag);



manipulatorforsettingstatusbits

ofthevalueflagintheLINT

statusvariable

manipulatortounsetstatusbits



LINT_omanip

ResetLintFlags(intflag);



ofvalueflagintheLINTstatus

variable



ostream&

operator<<(ostream&s,

constLINT&ln);



overloadedinsertoperatorfor

outputofLINTintegers,output

streamoftypeostream



ofstream&

operator<<(ofstream&s,

constLINT&ln);



overloadedinsertoperatorfor

writingLINTintegerstofiles,

outputstreamoftypeofstream



fstream&

operator<<(fstream&s,

constLINT&ln);



overloadedinsertoperatorfor

writingLINTintegerstofiles,

outputstreamoftypefstream



ifstream&

operator>>(ifstream&s,

LINT&ln);



overloadedextractoperatorfor

readingLINTintegersfromfiles,

inputstreamoftypeifstream



fstream&

operator>>(fstream&s,

LINT&ln);



overloadedextractoperatorfor

readingLINTintegersfromfiles,

input/outputstreamoftype

fstream



Team-Fly







Team-Fly







B.3BasicOperations:MemberFunctions

constLINT&

operator++(void);



incrementoperator(prefix)

++a;



constLINT

operator++(int);



incrementoperator(postfix)

a++;



constLINT&operator-(void);



decrementoperator(prefix)−

−a;



constLINT

operator--(int);



decrementoperator(postfix)a

−−;



constLINT&

operator+=(constLINT&b);



additionandassignmenta+=

b;



constLINT&

operator-=(constLINT&b);



subtractionandassignmenta

−=b;



constLINT&

operator*=(constLINT&b);



multiplicationandassignment

a*=b;



constLINT&

operator/=(constLINT&b);



divisionandassignmenta/=

b;



constLINT&

operator%=(constLINT&b);



remainderandassignmenta

%=b;



constLINT&

add(constLINT&b);



additionc=a.add(b);



constLINT&

sub(constLINT&b);



subtractionc=a.sub

(b);



constLINT&

mul(constLINT&b);

constLINT&

sqr(void);



multiplicationc=a.mul

(b);

squaringc=a.sqr(b);



divisionwithremainder

constLINT&

quotient=

divr(constLINT&d,LINT&r); dividend.div(divisor,

remainder);

Team-Fly







Team-Fly







B.4BasicOperations:FriendFunctions

constLINT

operator+(constLINT&a,

constLINT&b);

constLINT

operator-(constLINT&a,

constLINT&b);

constLINT

operator*(constLINT&a,

constLINT&b);

constLINT

operator/(constLINT&a,

constLINT&b);

constLINT

operator%(constLINT&a,

constLINT&b);

constLINT

add(constLINT&a,

constLINT&b);

constLINT

sub(constLINT&a,

constLINT&b);

constLINT

mul(constLINT&a,

constLINT&b);



additionc=a+b;



subtractionc=a−b;



multiplicationc=a*b;



divisionc=a/b;



remainderc=a%b;



additionc=add(a,b);



subtractionc=sub(a,b);



multiplicationc=mul(a,

b);



constLINT

sqr(constLINT&a);



squaringb=sqr(a);



constLINT

divisionwithremainder

quotient=div

divr(constLINT&a,

constLINT&b,LINT&r); (dividend,divisor,

remainder);

Team-Fly







Team-Fly







B.5ModularArithmetic:MemberFunctions

constLINT&

mod(constLINT&m);

constLINT&

mod2(constUSHORTu);



remainderb=a.mod(m);

remaindermodulopoweroftwo

2u,b=a.mod(u);



constint

comparisonofaandbmodulomif

mequ(constLINT&b,

constLINT&m)const; (a.mequ(b,m))...

constLINT&

madd(constLINT&b,

constLINT&m);



modularaddition,c=a.madd

(b,m);



constLINT&

msub(constLINT&b,

constLINT&m);



modularsubtraction,c=

a.msub(b,m);



constLINT&

mmul(constLINT&b,

constLINT&m);



modularmultiplication,c=

a.mmul(b,m);



constLINT&

msqr(constLINT&m);



modularsquaring,c=a.msqr

(m);



constLINT&

mexp(constLINT&e,

constLINT&m);



modularexponentiationwith

Montgomeryreductionforodd

modulusm,c=a.mexp(e,

m);



constLINT&

mexp(constUSHORTu,

constLINT&m);



modularexponentiationwith

USHORTexponent,Montgomery

reductionforoddmodulusm,c=



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

B.2 Input/Output, Conversion, Comparison: Friend Functions

Tải bản đầy đủ ngay(0 tr)

×