Operator (computer programming)

For example, a function that tests for greater-than could be named gt, but many languages provide an infix symbolic operator so that code looks more familiar.An operator, defined by the language, can be overloaded to behave differently based on the type of input.Some programming languages restrict operator symbols to special characters like + or := while others allow names like div (e.g. Pascal).Custom operators, particularly via runtime definition, often make correct static analysis of a program impossible, since the syntax of the language may be Turing-complete, so even constructing the syntax tree may require solving the halting problem, which is impossible.JavaScript follows different rules so that the same expression evaluates to "123.14" since 12 is converted to a string which is then concatenated with the second operand.In general, a programmer must be aware of the specific rules regarding operand coercion in order to avoid unexpected and incorrect behavior.
Operator (disambiguation)computer programmingprogramming languagefunctionsizeofsyntaxidentifiershort-circuitprefix notationprecedenceparenthesesmatchfixcircumfixexpressionoperandsassociativitybinary operatorsunary operatorspost-incrementternary operatorscope resolutionincrement operatorfluentnumbersconcatenatesstringsoverloadedingoverloadedPrologHaskellPascallexical specificationlexical analysisstatic analysisType conversionJavaScriptArithmeticRelationalgreater thanAssignmentThree-way comparisonRecordobjectTernary conditionalNull coalesingDereferenceCompound assignmentcis x = cos x + i sin xALGOL 68typeiddeletedecltypestatic_castdynamic castreinterpret_castconst_castRoslyninstanceofEiffelType classesmdiv modSmalltalkVisual Basic .NETOperators in C and C++