|
Data by itself can be pretty useless. Normally,
you want to do something with it. May be you want to divide
two numbers by each other, add two numbers together, or perhaps
check to see whether two sets of numbers added together are
equal to one another. These are all uses of expressions.
A numeric expression is simply the rudimentary
sort of mathematical operation that you're accustomed to,
expect written out in its full form.
Example :
50 + 10
8 / 2
48 % 7
-(15 * 6)
A logical (or Boolean) expression is that
when evaluated returns a result of either true or false.
The most common Logical operations are given in the table:
|
Operator
|
Name
|
Usage
|
|
&&
|
And
|
(exp1 &&
exp2) returns true if both exp1 and exp2 are true, otherwise returns false. |
|
||
|
Or
|
(exp1 &&
exp2) returns true only if either exp1 and exp2 are
true. |
|
!
|
Not
|
(!exp) returns
false only if exp1 is true, or true of exp is false. |
|
= =
|
Equal
|
(exp1 = = exp2)
returns true only if exp1 is equal to exp2. |
|
! =
|
Not Equal
|
(exp1! = exp2)
returns true only if exp1 is not equal to exp2. |
|
>
|
Greater than
|
(exp1> exp2)
returns true only if exp1 is greater than exp2. |
|
>=
|
Greater than or Equal
|
(exp1>= exp2)
returns true only if exp1 is greater than or equal to exp2. |
|
<
|
Less than
|
(exp1< exp2)
returns true only if exp1 is less than exp2. |
|
<=
|
Less than or Equal
|
(exp1<= exp2)
returns true only if exp1 is less than or equal to exp2. |
|
 |
 |
Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.
|
|