In C# one can make a positive int
negative using the minus sign -
like so:
var positiveInt = 5;
var negativeInt = -positiveInt;
Is a cost incurred when doing this (no matter how small)? I.e. is there an extra operation taking place under the hood when doing this (is the CPU actually multiplying the number by -1
)?