Logical negation

Definition

"!"(logicalnegation)logicaloperator.

"Logicalnegation"referstotheinversevalueoftheoriginalvalue.

Forexample:"!0"thevalueofthelogicalexpressionis1.(Ifthenumberjudgedis0,ifitistrue,thevalueoftheexpressionis1)

"!1"Thevalueofthislogicalexpressionis0.(Ifthenumberjudgedisnot0,itisnottrue,thenthevalueoftheexpressionis0)

Properties

Theoperationvariables(orconstants)areconnectedtoformalogicalexpression.

Thereare3logicaloperators,theyare:!(Logicalnegation),||(logicalOR),&&(logicalAND).Therearealso&(bitwiseAND),|(bitwiseOR),and^(bitwiseexclusiveOR)operationsinbitwiseoperations.

!Operatorshavethehighestlevelamonglogicaloperators.

Application

Whatislogicaloperation-logicaloperationisusedtojudgewhetherathingis"right"or"wrong",orwhetheritis"true"or"nottrue",Theresultofthejudgmentisbinary,thatis,thereisno"maybe"or"maynot".Theusageofthis"maybe"isafuzzyconcept.Binaryoperationsarecarriedoutinthecomputer,andtheresultoflogicaljudgmenthasonlytwovalues.Thesetwovalues​​arecalled"logicalvalues",andthesymbolsofnumbersare"1"and"0".Amongthem,"1"meansthattheresultofthelogicaloperationis"established".Iftheresultofalogicaloperationis"0",thenthecontentofthelogicaloperationis"notestablished".IntheLinuxsystem,theoppositeistrue.Iftheresultis"0",thenthisexpressioniscorrect,iftheresultisnot"0",thenthisexpressioniswrong.

Related Articles
TOP