Negative Function
how do I negate an number?
I am memo I put [NOT(4)] and the result is -5
I was especting to get -4
Please comment.
Best regards
I am memo I put [NOT(4)] and the result is -5
I was especting to get -4
Please comment.
Best regards
Comments
signed integer -2 147 483 648...+2 147 483 647
in hex (negative) 0XFFFFFFFF80000000 (-2 147 483 648) ... 0XFFFFFFFFFFFFFFFF( -1)
positive 0X0000000000000000(0) .... 0X0000000080000000(+2 147 483 647)
for example you have 4 (0X0000000000000004), not (4) inverts all bits and you get 0XFFFFFFFFFFFFFFFB (-5).
in binary:
0000000000000000000000000000000000000000000000000000000000000100(4)
inverted
1111111111111111111111111111111111111111111111111111111111111011(-5)
I don't know why you especting to get -4
What is the simplest way to get the negative of a positive number or the positive of a negative number?
eg. 4 to -4 or -4 to 4
I am currently using this formual (-1)X mutiplyling the number by -1
(-1)4 = -4 and
(-1)-4 = 4
Regards
All these years have past. I remember when i just started using Fast Reports