{{fbdoc item="title" value="Operator -= (Subtract and Assign)"}}---- Subtracts and assigns a value to a variable {{fbdoc item="syntax"}}## [[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **-=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] //T1//, [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] //T2// ) [[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **-=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] //T// [[KeyPgPtr|ptr]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgInteger|integer]] ) ## {{fbdoc item="usage"}}## //lhs// **-=** //rhs// ## {{fbdoc item="param"}} ##//lhs//## The variable to assign to. ##//T1//## Any numeric type. ##//rhs//## The value to subtract from ##//lhs//##. ##//T2//## Any numeric type. ##//T//## Any data type. {{fbdoc item="desc"}} This operator subtracts and assigns a value to a variable. It is functionally equivalent to: ##//lhs// = //lhs// [[KeyPgOpSubtract|-]] //rhs//## For numeric types, the right-hand side expression (##//rhs//##) will be converted to the left-hand side type (##//T1//##). This operator can be overloaded for user-defined types as a member ##[[KeyPgOperator|Operator]]## using the appropriate syntax. //Note: Similarly to the operator '=[>]' (assign), the alternative symbol '-=>' can be also used.// {{fbdoc item="ex"}} {{fbdoc item="filename" value="examples/manual/operator/subtract-assign.bas"}}%%(freebasic) DIM n AS DOUBLE n = 6 n -= 2.2 PRINT n SLEEP %% Output: %% 3.8 %% {{fbdoc item="lang"}} - In the //[[CompilerOptlang|-lang qb]]// dialect, this operator cannot be overloaded. {{fbdoc item="diff"}} - New to ""FreeBASIC"" {{fbdoc item="see"}} - ##[[KeyPgOpSubtract|Operator - (Subtract)]]## - [[CatPgMath|Mathematical Functions]] {{fbdoc item="back" value="CatPgOpAssignment|Assignment Operators"}}{{fbdoc item="back" value="CatPgOperators|Operators"}}