Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logical negation operator in F#? (!-equivalent)

What is the equivalent to the C# "!" operator in F#?

like image 992
JacobE Avatar asked Oct 27 '08 13:10

JacobE


People also ask

What is the logical operator for negation?

The ! (logical negation) operator determines whether the operand evaluates to 0 (false) or nonzero (true). The expression yields the value 1 (true) if the operand evaluates to 0, and yields the value 0 (false) if the operand evaluates to a nonzero value.

What is negate operation?

In logic, negation, also called the logical complement, is an operation that takes a proposition to another proposition "not ", written , or . It is interpreted intuitively as being true when is false, and false when is true. Negation is thus a unary logical connective.

How do you do negation in Java?

The not operator is a logical operator, represented in Java by the ! symbol. It's a unary operator that takes a boolean value as its operand. The not operator works by inverting (or negating) the value of its operand.

What is negation in Python?

Negation: The not operator in Python can be used only in the unary form, which means negation, returning the a result that is the opposite of its operand. Its boolean prototype is not (bool) -> bool.


1 Answers

According to "Foundations of F#", page 61:

F# uses a function called not for Boolean "not" operations.

like image 64
Jon Skeet Avatar answered Sep 20 '22 17:09

Jon Skeet