Heh...

This is a discussion on Heh... within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Originally Posted by simpleid yarin, my best guess, there are two sets of symbols for instructions to manipulate information, those ...

  1. #16
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Quote Originally Posted by simpleid View Post
    yarin, my best guess, there are two sets of symbols for instructions to manipulate information, those used in the decimal system through out history in mathematics, and those designed to mimic logic gates in math/engineering.

    it doesn't have to do with the fact that they overlooked duplicates or anything.

    you'll find an equivalent logical operation for a whole lot of things.
    I get it now. I quoted the wrong person in my original post. I had meant to quote the original poster, not you. Not sure how I did that. Sorry if you took offense.

  2. #17
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Try replacing your "pluses" with "narrow beams".

    Code:
    #include <stdio.h>
    
    int main(void)
    {
    	printf("2 + 2 = &#37;d\n", 2 + 2);
    
    	return 0;
    }


    You're annoying me just fyi.

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    Code:
    #include <iostream>
    
    int main()
    {
        std::cout << "5 + 7  = " << (5+7) << "\n\n";
        std::cout << "5 | 7  =  " << (5|7) << "\n\n";
    
        std::cout << "5 - 7  = " << (5-7) << "\n\n";
        std::cout << "5 &~ 7 = " << (5&~7) << "\n\n";
    }

  4. #19
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,610
    >> You're annoying me just fyi.

    <homer>Woo Hoo!!!</homer>
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  5. #20
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    lol, oh damn, i wanted to know what the technical term for the '|' was, and when I typed it in to google, the page went blank!?! ...gah, it won't return any results at all.

    I guess it's a 'bar'... ?

    my friend says 'pipe', cool. alright.

  6. #21
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I believe the technical name is "vertical bar".

    Pipe is what it's used for when chaining commands together in a shell/command prompt, e.g. find -name "*.c"|xargs grep printf|wc -l, which will show how many lines of "printf" there are in the .c files recursively the current directory.

    --
    Mats

  7. #22
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    See Wikipedia for the name:
    The name of the character (|) is the Sheffer stroke, though often referred to as a pipe (by the Unix community) and Vertical bar, verti-bar, vertical line or divider line by others.

    Broken bar (&#166 is a separate character.
    I use vertical bar, and I'll understand you if you said pipe. (I'd give you odd looks for "Sheffer stroke" though.) "vertical bar" would probably be the most understood.

    Although if you're dealing with code, you might want to use the name of the operation (binary OR) and not "vertical bar".
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  8. #23
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Having just taken a Unix Programming course and learned how cool pipes are, I now refer to it as a pipe, even though it's not.

  9. #24
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Posts
    311
    One is a addition operator and one is a bitwise or operator, quite different by any opinion.
    GCC on Fedora Core 10

  10. #25
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Heh. Not a very good title for a thread eh?

  11. #26
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    I've also noticed that '*' = '+', lol

    for example
    Code:
    2 + 2 = 4
    yet, if I replace + with *,
    Code:
    2 * 2 = 4
    OMG!

    </sarcasm>

  12. #27
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    bitwise operators == logical operators which are the fundamental bases to mathematical operations (in computing)!

    | = OR
    & = AND
    ! = NOT
    ^ = XOR

    They can be mixed and mingled to create all operations in mathematics, and physically* are. If you learn some engineering you'll see all mathematics, multiplication, division, etc etc are logical operations!

    examples:
    T | F = T
    T & F = F
    !T = F
    T ^ F = T

    (you can substitute T = 1, and F = 0)

    http://en.wikipedia.org/wiki/AND
    http://en.wikipedia.org/wiki/OR
    http://en.wikipedia.org/wiki/XOR
    http://en.wikipedia.org/wiki/NOT_gate


    there's more, like NAND and such... which -all- can be mimic'd with c++ operators, and all can perform multiplication and all other mathematical operations.

    while they themselves are -not- identical, they can perform identical functions. and do. there *really* is no such thing as '+' (plus) or '-' (minus), or any other of the 'higher level operations'.... go ahead and research it.

    http://books.google.com/books?id=kGu...foqMCjepD-QgPM


    happy now?
    Last edited by simpleid; 08-17-2007 at 12:23 PM.

  13. #28
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,610
    Yes!
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Heh...
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 04-04-2006, 07:16 AM
  2. Help with my function (Heh)
    By phatsam in forum C Programming
    Replies: 9
    Last Post: 03-23-2006, 12:26 PM
  3. How long have you guys been working with C/C++??
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 08-01-2003, 03:41 PM
  4. Dual Monitor question heh
    By RoD in forum Tech Board
    Replies: 2
    Last Post: 07-11-2003, 01:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21