6

I do not ever think I have ever had a need to type this character "¬", and so I was wondering what it is called and what it is for and why it is on the my keyboards (both my UK and EU keyboards)? I assume that it had some common function back in the 1970's maybe, but I'm curious what that might be as I'm almost completely certain that I have never once in over 25 years ever had a need to type this character for anything. I do use the tilde character "`" a lot, but never the shift-variant on that key of the "¬".

Part of the reason that I am asking this is that I might use it as an AutoHotkey trigger, since it seems so completely useless to me, but I was curious about what it might be for etc before I do that.

YorSubs
  • 3,194
  • 7
  • 37
  • 60
  • It's used in Math and logic. Not in programming(hard to type, maybe? Easier if you use `~` or `!`, same thing) – WesternGun Mar 31 '23 at 19:30

2 Answers2

8

It's the logic negation symbol.

It's used in some programming languages as a mean to negate a boolean value, particulary old languages

Educorreia
  • 375
  • 5
  • 21
  • 2
    Interesting, come to think of it, that does sort of sound like something I might have heard in the distant past, but, I use bash, python, C#, PowerShell, AutoHotkey and a few other languages and I've never seen this used. hmm, maybe it's used in something ancient like Fortran. Great, I think I can safely use this for other purposes then, thanks! – YorSubs Feb 27 '21 at 15:22
  • 2
    What's also pretty interesting that this symbol is not anywhere on US keyboards. If we're talking about the same backtick key in the upper left (under `Esc`), the secondary symbol on ours is a tilde (`~`). Do you not have this key across the pond? – Mike Mar 07 '21 at 21:57
  • 5
    @YorSubs Generally programming languages don't use it as it's not on US keyboards nor in ASCII. However, when writing out logical expressions it is used: `¬(x∧y)` means NOT (x AND y); in programming this would (generally) be written as `!(x && y).` – VFDan Mar 08 '21 at 18:40
  • 1
    Yup, it's used a lot in AI-based systems when we are building a knowledge base where we need to evaluate rules based on Predicates. – Yatender Singh Apr 29 '22 at 07:46
  • 1
    I see this `¬` symbol in Coq Programming Language (Proof Assistant), it's the the logical negation operator there too! There, `¬ P` reads as "not P". – eri0o May 03 '23 at 01:23
3

The ¬ character is also used in AppleScript to force a long line of code to break onto the next line. On a French Mac keyboard, you get it with Option (alt) "L", which has a kind of logic to it :)

Fred
  • 33
  • 5