Negative Function

edited 3:31PM in FastReport 3.0
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

Comments

  • edited August 2006
    NOT is a boolean operation.

    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 ;)
  • edited 3:31PM
    OK Den thanks for the information, I am learning every day.

    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
  • edited 3:31PM
    wrote:
    I am currently using this formual (-1)X mutiplyling the number by -1
    Now you use correct method ;)
  • edited 3:31PM


    All these years have past. I remember when i just started using Fast Reports

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.