Skip to main content

View Diary: What Happens When DKos Reaches UID 1,000,000? (54 comments)

Comment Preferences

  •  could be run on a mainframe... (1+ / 0-)
    Recommended by:
    Dbug

    ...and then you have to ask if it is one's complement or not.

    We Glory in war, in the shedding of human blood. What fools we are.

    by delver rootnose on Sat Aug 31, 2013 at 12:41:41 AM PDT

    [ Parent ]

    •  So, in 1's complement (1+ / 0-)
      Recommended by:
      Dbug

      You have 2 zeroes.  You have this one:
          0x00000000

      And you have this one:
          0xFFFFFFFF

      It would have to be a really old mainframe to not use 2's complement.

      But I read in a TCP/IP book a long time ago that they use 1's complement on the Checksum on a header because you can distinguish between a checksum that equals 0 and a checksum that was never computed.

      Republicans: Taking the country back ... to the 19th century

      by yet another liberal on Sat Aug 31, 2013 at 12:58:46 AM PDT

      [ Parent ]

      •  I only know about twos complement. (1+ / 0-)
        Recommended by:
        yet another liberal

        I consider 0xFFFFFFFF to be -1 (decimal).

        The bit at the end is the positive/negative bit. To switch positive to negative, you just XOR (or EOR, depending on the convention). That's 64 bits, of course. I'd have to think a bit to figure out how ones complement works. Maybe I'll google it.

        Hey! Can I brag to you that I once figured out how to calculate a square root in binary in 6502 assembly language (Apple II, Commodore 64), which didn't even have multiply or divide instructions? If you know how to do it in base 10, binary square roots are simple.

        And I'll also say I hate floating point numbers. Too messy.

        Also, if you're programming something with vectors or circles, forget about converting back and forth from 360 degrees. Use either 256 degrees or 65,536 degrees. It's much simpler. Does that make sense to you?

        "Stupid just can't keep its mouth shut." -- SweetAuntFanny's grandmother.

        by Dbug on Sat Aug 31, 2013 at 01:29:26 AM PDT

        [ Parent ]

        •  Yeah, cool (1+ / 0-)
          Recommended by:
          Dbug

          I never tried to do a sqrt() with integers.

          And yeah, I see what you mean with 256 or 65536 and a circle.  Chop the thing up into the best resolution you can get with your bits (8-bits use 256 pie slices, 16-bit use 65536 pie slices) instead of degrees.  Good idea, I like it.

          Republicans: Taking the country back ... to the 19th century

          by yet another liberal on Sat Aug 31, 2013 at 11:07:46 AM PDT

          [ Parent ]

        •  For what it's worth, ... (1+ / 0-)
          Recommended by:
          Dbug

          I managed to put my underwear on correctly this morning.


          Reality occupies a dimly lit corner somewhere on the edge of town. I drive by every now and then on my way to visit mom. That’s where the cookie jar is.

          by glb3 on Sat Aug 31, 2013 at 07:22:35 PM PDT

          [ Parent ]

Subscribe or Donate to support Daily Kos.

Click here for the mobile view of the site