Signed int -0 ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Victor Bazarov

    #16
    Re: Signed int -0 ?

    "Ron Natalie" <ron@sensor.com > wrote...[color=blue]
    >
    > "Jack Klein" <jackklein@spam cop.net> wrote in message[/color]
    news:2c0agv8eek oificl7rmqab2tp arvn5scsr@4ax.c om...[color=blue]
    >[color=green]
    > > There are three defined formats for the representation of negative
    > > signed integer values.[/color]
    >
    > Only in C99.[/color]

    What is that supposed to mean? The representation of negative
    integers is not language-specific, it's hardware-specific.


    Comment

    • Ron Natalie

      #17
      Re: Signed int -0 ?


      "Victor Bazarov" <v.Abazarov@att Abi.com> wrote in message news:vgiuhdtd04 uc26@corp.super news.com...[color=blue]
      > "Ron Natalie" <ron@sensor.com > wrote...[color=green]
      > >
      > > "Jack Klein" <jackklein@spam cop.net> wrote in message[/color]
      > news:2c0agv8eek oificl7rmqab2tp arvn5scsr@4ax.c om...[color=green]
      > >[color=darkred]
      > > > There are three defined formats for the representation of negative
      > > > signed integer values.[/color]
      > >
      > > Only in C99.[/color]
      >
      > What is that supposed to mean? The representation of negative
      > integers is not language-specific, it's hardware-specific.
      >[/color]
      C99 defines (well limits the allowable) integer formats to three (signed mag, 1's comp.,
      and 2's comp.). There is NO such restriction in C++. Any encoding that meets the
      requirement that the positive numbers share representation with the corresponding unsigned
      type meets the requirement.


      Comment

      • Victor Bazarov

        #18
        Re: Signed int -0 ?

        "Ron Natalie" <ron@sensor.com > wrote...[color=blue]
        >
        > "Victor Bazarov" <v.Abazarov@att Abi.com> wrote in message[/color]
        news:vgiuhdtd04 uc26@corp.super news.com...[color=blue][color=green]
        > > "Ron Natalie" <ron@sensor.com > wrote...[color=darkred]
        > > >
        > > > "Jack Klein" <jackklein@spam cop.net> wrote in message[/color]
        > > news:2c0agv8eek oificl7rmqab2tp arvn5scsr@4ax.c om...[color=darkred]
        > > >
        > > > > There are three defined formats for the representation of negative
        > > > > signed integer values.
        > > >
        > > > Only in C99.[/color]
        > >
        > > What is that supposed to mean? The representation of negative
        > > integers is not language-specific, it's hardware-specific.
        > >[/color]
        > C99 defines (well limits the allowable) integer formats to three (signed[/color]
        mag, 1's comp.,[color=blue]
        > and 2's comp.). There is NO such restriction in C++. Any encoding[/color]
        that meets the[color=blue]
        > requirement that the positive numbers share representation with the[/color]
        corresponding unsigned[color=blue]
        > type meets the requirement.[/color]

        Would you say, then, that C99 is smarter about it or that C++
        is more flexible about it? AFAIK, there are no other schemes
        than the three mentioned in this thread...

        Victor


        Comment

        • Ron Natalie

          #19
          Re: Signed int -0 ?


          "Victor Bazarov" <v.Abazarov@att Abi.com> wrote in message news:vgj6q1arp7 lt1f@corp.super news.com...
          ..[color=blue]
          >
          > Would you say, then, that C99 is smarter about it or that C++
          > is more flexible about it? AFAIK, there are no other schemes
          > than the three mentioned in this thread...
          >[/color]
          Got me. I've never understood why they were suddenly enumerated
          in C99. To my knowledge I've never worked on a signed-mag machine
          and I haven't been near a 1's complement machine in over a decade.


          Comment

          • Alexander Terekhov

            #20
            Re: Signed int -0 ?


            Ron Natalie wrote:
            [...][color=blue]
            > Got me. I've never understood why they were suddenly enumerated
            > in C99. To my knowledge I've never worked on a signed-mag machine
            > and I haven't been near a 1's complement machine in over a decade.[/color]

            How about offset binary (aka "Excess-K"), various BCD schemes, uhmm,
            and "gray code"? ;-)

            regards,
            alexander.

            Comment

            • Ron Natalie

              #21
              Re: Signed int -0 ?


              "Alexander Terekhov" <terekhov@web.d e> wrote in message news:3F09B262.9 9C834AB@web.de. ..[color=blue]
              >
              > Ron Natalie wrote:
              > [...][color=green]
              > > Got me. I've never understood why they were suddenly enumerated
              > > in C99. To my knowledge I've never worked on a signed-mag machine
              > > and I haven't been near a 1's complement machine in over a decade.[/color]
              >
              > How about offset binary (aka "Excess-K"), various BCD schemes, uhmm,
              > and "gray code"? ;-)
              >[/color]
              These aren't legal in C++ because they don't share the postitve number
              representation with the unsigned.


              Comment

              Working...