two's complement done before storage or on the fly while computing

Discussion in 'C Programming' started by Greenhorn, Aug 26, 2005.

  1. Greenhorn

    Greenhorn Guest

    Hi,
    Is two's complement always used as a storage method or is it computed
    while computing the expression involved.
    e.g., int a = -2, b = 3, c = 4, d;
    d = b - c;

    Here, is always 'a' stored as two's complement of '2'?
    or
    is always '-c' (two's complement of c) computed on the fly and the
    resulting value is added to b ( b + (-c))?

    Joe
    Greenhorn, Aug 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mantorok Redgormor

    sign magnitude, ones complement, two's complement

    Mantorok Redgormor, Oct 5, 2003, in forum: C Programming
    Replies:
    8
    Views:
    8,570
    Glen Herrmannsfeldt
    Oct 8, 2003
  2. Greenhorn
    Replies:
    7
    Views:
    496
    Lawrence Kirby
    Aug 31, 2005
  3. sarathy

    1's complement and 2's complement

    sarathy, Aug 1, 2006, in forum: C Programming
    Replies:
    20
    Views:
    2,168
    Bo Persson
    Aug 2, 2006
  4. sarathy
    Replies:
    22
    Views:
    2,313
    Bo Persson
    Aug 2, 2006
  5. Roberto Waltman

    2's complement vs. 1's complement vs. ...

    Roberto Waltman, Jun 9, 2011, in forum: C Programming
    Replies:
    4
    Views:
    1,334
    Michael Press
    Jun 14, 2011
Loading...

Share This Page