operator >> on signed in c89

Discussion in 'C Programming' started by Simon Aittamaa, Oct 12, 2005.

  1. The value of E1 >> E2 when E1 has a signed type and is negative is
    implementation-defined in c99 (6.5.7), is that the case for c89 as well?

    I'm guessing it is but I would like to be sure. Does anyone have a good
    web-resource of the c89 standard?

    - Simon Aittamaa
     
    Simon Aittamaa, Oct 12, 2005
    #1
    1. Advertisements

  2. Simon Aittamaa

    Eric Sosman Guest

    Simon Aittamaa wrote On 10/12/05 14:19,:
    > The value of E1 >> E2 when E1 has a signed type and is negative is
    > implementation-defined in c99 (6.5.7), is that the case for c89 as well?


    ANSI Classic 3.3.7 (probably a different section number
    in ISO's version):

    The result of E1 >> E2 is [...]. If E1 has a signed
    type and a negative value, the resulting value is
    implementation-defined.

    --
     
    Eric Sosman, Oct 12, 2005
    #2
    1. Advertisements

  3. Eric Sosman wrote:
    >
    > Simon Aittamaa wrote On 10/12/05 14:19,:
    >
    >>The value of E1 >> E2 when E1 has a signed type and is negative is
    >>implementation-defined in c99 (6.5.7), is that the case for c89 as well?

    >
    >
    > ANSI Classic 3.3.7 (probably a different section number
    > in ISO's version):
    >
    > The result of E1 >> E2 is [...]. If E1 has a signed
    > type and a negative value, the resulting value is
    > implementation-defined.
    >


    Thanks :)

    - Simon Aittamaa
     
    Simon Aittamaa, Oct 12, 2005
    #3
    1. Advertisements

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. G Patel
    Replies:
    1
    Views:
    711
  2. Thomas Matthews

    operator % and signed integers

    Thomas Matthews, Dec 17, 2005, in forum: C Programming
    Replies:
    9
    Views:
    523
    Jordan Abel
    Dec 28, 2005
  3. Replies:
    6
    Views:
    616
  4. Thomas Matthews

    operator % and signed integers

    Thomas Matthews, Dec 17, 2005, in forum: C++
    Replies:
    8
    Views:
    454
    Jordan Abel
    Dec 28, 2005
  5. RezaRob

    ~ operator returns signed value

    RezaRob, Sep 23, 2007, in forum: C Programming
    Replies:
    15
    Views:
    654
  6. kyrpa83
    Replies:
    1
    Views:
    825
    kyrpa83
    Oct 17, 2007
  7. Rob1bureau
    Replies:
    1
    Views:
    988
    joris
    Feb 27, 2010
  8. dr.oktopus

    mod operator for signed integers

    dr.oktopus, Apr 9, 2011, in forum: C Programming
    Replies:
    12
    Views:
    577
    Eric Sosman
    Apr 10, 2011
Loading...