Not operator
Performs a logical non operation on an expression.
result = Not expression
Parameters
Result
Any numeric variable.
Expression
An arbitrary expression.
Description
The following table shows how to determine the value of result:
If expression is
The result is
True
False
False
True
Null
Null
In addition , the not operator n
Or operator
Make a logical or an operation of two expressions.
result = expression1 Or expression2
Parameters
Result
Any numeric variable.
Expression1
An arbitrary expression.
Expression2
An arbitrary expression.
Description
If at least one of the two expressions is true, result is true. The following table shows how to determine result:
If expression1 is
expression2 for
The result is
True
True
True
Tru
IMP operator
The logical implication operation is performed on two expressions.
result = expression1 Imp expression2
Parameters
Result
Any numeric variable.
Expression1
An arbitrary expression.
Expression2
An arbitrary expression.
Description
The following table shows how to determine the value of result:
If expression1 is
and Expression2 is
The result is
True
True
True
True
False
False
Mod operator
Divides two values and returns the remaining numbers.
result = number1 Mod number2
Parameters
Result
Any numeric variable.
Number1
An arbitrary numeric expression.
Number2
An arbitrary numeric expression.
Description
Modulus or remainder. The operator performs number1 divided by the number2 action (the floating-point number is rounded to an integer ) and returns only the remainder as
The three-mesh operator is the ternary operator
The ternary expressions of some languages (such as Java) are as follows:
A result when a condition is true: the result of a false decision
Result=x if X
Python's ternary expression has the following several ways of writing:
if __name__ = = ' __main__ ':
a = '
b = ' True '
c = ' False '
#方法一: Results of true if the result if the condition else
C language-bitwise operator, C language-OperatorI. bitwise operators 1. bitwise AND :
1> Functions
* The result bit is 1 only when the corresponding two binary bits are 1. Otherwise, the result bit is 0.
* Example: 10 is represented as 1010 in binary format and 7 is represented as 0111 in binary format. Calculate two values
* 1010
0111
--------------------
0010
* Rule: In the binary system, it is in the same position as the 1 phase, and the 0 phase is
And Operator
Perform logical "and" operations on the two expressions.
result = expression1 And expression2Parameters
Result
Any numeric variable.
Expression1
Any expression.
Expression2
Any expression.Description
If and only when both expressions areTrue, ThenResultIsTrue. If any expression isFalse, ThenResultIsFalse. The following table describes how to determineResult:
If expression1 is
And expression2 is
The result is
True
MoD Operator
Divide two values and return the remaining values.
Result = number1MoDNumber2Parameters
Result
Any numeric variable.
Number1
Any numeric expression.
Number2
Any numeric expression.Description
Modulus or remainder. Operator executionNumber1DividedNumber2Operation (floating point rounding is an integer) and returns only the remainderResult. For example, in the following expression, (Resu
In C ++, the arrow operator (->) vs the vertex operator (.)
A pointer is displayed on the left.An object is on the left.If P is a pointer, p-> function ();If P is an object, P. function ();Remember-> the left must be a pointer, and the left must be an object or a struct, generally a class object.First, we will introduce the structure in C ++. For a structure,
Struct mystruct{Int member_a;};
If there is a
About the shift left operator in C language, the shift left Operator
Referring to c and pointer, the result of left shifting in c language is the same regardless of arithmetic or logical left shifting. In addition, perform the same operation for the signed and unsigned types, that is, shift N bits to the left Based on the binary bit. For example:
1 clude
ubuntu@ubuntu:~/code/2017.8.28$ ./test31610612734510
Arithmetic operatorsBefore the article in the introduction of variable types, in fact already used a lot of arithmetic characters, such as + 、-、 *,/,//, * *, and so on, in addition, there is a symbol is not mentioned before, is%, used to return the division of the remainder of the operation symbol.Assuming that the variables x and y,x are 10,y to 3,x%y, the result is 1.There are precedence in the operators, as in mathematics, so there are some need for precedence in writing, such as: 3 * (4 + 5)
Value assignment operator function, value assignment operatorQuestion: The following is a declaration of the type CMyString. Please add a value assignment operator function for this type.
1 class CMyString2 {3 public: 4 CMyString (char * pData = NULL); // constructor 5 CMyString (const CMyString str); // copy constructor 6 ~ CMyString (); // destructor 7 private: 8 char * m_pData; // data field, character
Differences between the element group and the array when python uses the in operator, and the python Operator
In python, you can use the in symbol to determine whether the specified element exists in the list. However, I found that there are differences between tuples and arrays. The following is the detailed experiment result.
>>> 'Jb51. net 'in ['haotu.. net ', 'jb51.. net '] True> 'jb51. net 'in ('haot
Problem: Mainly because the JDK version is differentSolve:Method one:listMethod Two: Reinstall the version of JDK8 (install and configure environment variables)File->project structure->modules->language level is selected as version 7, mainly because the JDK version does not supportThe following problem occurs after the modificationProblem:Solve:Results:Error: (+) Java: The diamond operator is not supported in-source 1.5 (please use-source 7 or later t
First look at the use of single oblique bar: To give a few examples>>> print (5/3), type (5/3)1.6666666666666667(None, >>> print (6/3), type (6/3)2.0(None, >>> print 5.0/3,type (5.0/3)1.66666666667 >>> print 5/3.0,type (5/3.0)1.66666666667 >>> print 5.0/3.0,type (5.0/3.0)1.66666666667 As can be seen, whether the value is divisible, or A/b is not an int type, single slash action is all float type, the result is to retain a number of decimal places, is our normal thinking of the division operation
EQV operator
Performs the logical equivalence operation of two expressions.
result = expression1 Eqv expression2
Parameters
Result
Any numeric variable.
Expression1
An arbitrary expression.
Expression2
An arbitrary expression.
Description
If any of the expressions are null, result is also null. When two expressions are not Null , the value of result is determined according to the following table:
If expression1 is
and Expression2 is
Take a moment to jot down a point of knowledge that is being developed today.
In PHP, when comparing two object variables with the comparison operator (= =): If the properties and property values of the two objects are equal, and two objects are instances of the same class, the two object variables are considered equal.
If you use the strict equality operator (= = =), the two object variables must point t
Xor operator
Makes a logical "XOR" operation on two expressions.
result = expression1 Xor expression2
Parameters
Result
Any numeric variable.
Expression1
An arbitrary expression.
Expression2
An arbitrary expression.
Description
If there is and only one expression is true, result is true. However, if any of the expressions are null, result is also null. If two expressions are not Null, result is determined according to the following table :
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.