{{fbdoc item="title" value="Operator ^= (Exponentiate and Assign)"}}----
Exponentiates and assigns a value to a variable

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **^=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgDouble|double]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgDouble|double]] )
##
{{fbdoc item="usage"}}##
	//lhs// **^=** //rhs//
##
{{fbdoc item="param"}}
	##//lhs//##
		The variable to assign to.
	##//rhs//##
		The value to exponentiate ##//lhs//## by.

{{fbdoc item="desc"}}
	This operator exponentiates and assigns a value to a variable. It is functionally equivalent to:
		##//lhs// = //lhs// [[KeyPgOpExponentiate|^]] //rhs//##
		
	This operator can be overloaded for user-defined types as a member ##[[KeyPgOperator|Operator]]## using the appropriate syntax.
	
	Note: This operator exists in C/""C++"" with a different meaning - there it performs a Bitwise ##[[KeyPgOpCombineXor|Xor=]]##.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/operator/exponent-assign.bas"}}%%(freebasic)
DIM n AS DOUBLE
n = 6
n ^= 2
PRINT n
SLEEP
%%
Output:
%%
36
%%

{{fbdoc item="lang"}}
	- In the //[[CompilerOptlang|-lang qb]]// dialect, this operator cannot be overloaded.

{{fbdoc item="diff"}}
	- New to ""FreeBASIC""

{{fbdoc item="see"}}
	- ##[[KeyPgOpExponentiate|Operator ^ (Exponentiate)]]##
	- [[CatPgMath|Mathematical Functions]]

{{fbdoc item="back" value="CatPgOpAssignment|Assignment Operators"}}{{fbdoc item="back" value="CatPgOperators|Operators"}}