It is a rule in math that the absolute value of a number must be no less than zero. Is it true in computer languages? Well, most of the case except one. Let me take C language for example.
For a 32-bits C interger, its value ranges from [-2147483648, 2147483647] .So for x = -2147483648
, what is the result of abs(x)
? 2147483648
, -2147483648
, 2147483647
, 0
or something else?
…