You can also use the unary minus operator before variables to negate their values. For example, if we have the variablexof 2 and put-xbefore it, its value will become -2, and if we hadyof 10 and put-ybefore it, its value would become -10 as well. ...
The unary negation operator (–) produces the negative of its operand. The operand to the unary negation operator must be an arithmetic type.Integral promotion is performed on integral operands, and the resultant type is the type to which the operand is promoted. See Integral Promotions for ...
Complex.UnaryNegation(Complex) Operator Reference Feedback Definition Namespace: System.Numerics Assembly: System.Runtime.Numerics.dll Source: Complex.cs Returns the additive inverse of a specified complex number. C# Copy public static System.Numerics.Complex operator - (System.Numerics.Complex ...
Computes the checked unary negation of a value. C# staticcharIUnaryNegationOperators<char,char>.op_CheckedUnaryNegation (charvalue); Parameters value Char The value for which to compute the unary negation. Returns Char The unary negation ofvalue. ...
publicstaticSystem.Numerics.Quaternionoperator- (System.Numerics.Quaternionvalue); Parameters value Quaternion The quaternion to negate. Returns Quaternion The negated quaternion. Remarks TheUnaryNegationmethod defines the operation of the unary negation operator forQuaternionobjects. ...
This operators also known as Bitwise negation and one’s compliment operator in C language, it is a Unary operator in C and C++, it converts (inverse) individual bits from 0 to 1 and 1 to 0.For example: there is a variable x with value 0xAA (in binary 1010 1010), ~x will be ...
Namespace: Microsoft.WindowsMobile.DirectX.Direct3D Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)SyntaxC# Copy public static FixedPoint operator -( FixedPoint value ) Parametersvalue Type: Microsoft.WindowsMobile.DirectX.Direct3D.FixedPoint A value to negate....
! Logical Negation Reverses logical state of the operand sizeof() Sizeof Returns size of the operand ~ One’s Compliment Bitwise One’s Compliment Unary Plus (+) This Unary Operator is denoted by the ‘+’ sign and it does not make any difference to the value of the ope...
–Unary negation ––Decrement And all of them are overloadable through a global function as well as a non-static member-function (btw: the only operators that are only overloadable as non-static members are =, ->, [] and ()). ...
The unary negation operator (-) precedes its operand and negates it.Both the unary negation and plus perform the same operation as the Number() function for non-numbers.Here are some examples:OperationResult -3 -3 -"3" -3 -"-3" 3 -"3.14" -3.14 -"123e-5" -0.00123 -"0xFF" -255...