3 ms·
Fortran has .and. and .or. for logical operators, which is pretty easy to remember. & seems pretty obvious, of course they couldn’t have known at the time that
by bee_rider 3y ago
Fortran has .and. and .or. for logical operators, which is pretty easy to remember.
& seems pretty obvious, of course they couldn’t have known at the time that logical operations should probably be given priority over bitwise ones.
| is an odd symbol. They don’t really justify it in the stack overflow answer, just mention where it came from.
Unix pipe, conditional probability, and or. I guess a vertical line is naturally going to be very popular though.
- adrian_b 3y agoThe early character sets that were available in teletypes and line printers were not selected with the purpose of writing mathematical notation, but with the purpose of writing "business correspondence". Because of this, the authors of most early programming languages, with the exception of APL\360 and of some European programming languages, which were not restricted to the IBM business-oriented character sets, had to replace the traditional mathematical symbols with whatever "business" characters were more suitable. There is nothing odd about "|". It was included in the "business" symbols, for drawing tables. Among the few available symbols, it was doubtless the most appropriate choice for "OR".