This is my first php program!



Download 6,9 Mb.
Pdf ko'rish
bet30/69
Sana26.02.2022
Hajmi6,9 Mb.
#471647
1   ...   26   27   28   29   30   31   32   33   ...   69
Bog'liq
PHP

Type of first operand
Type of second operand
Conversion performed
Integer
Floating point
The integer is converted to a floating-point number
Integer
String
The string is converted to a number; if the value after conversion is a
floating-point number, the integer is converted to a floating-point
number
Floating point
String
The string is converted to a floating-point number
,ch02.15294 Page 37 Wednesday, March 13, 2002 11:42 AM


This is the Title of the Book, eMatter Edition
Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.
38
|
Chapter 2: Language Basics
Arithmetic Operators
The arithmetic operators are operators you’ll recognize from everyday use. Most of
the arithmetic operators are binary; however, the arithmetic negation and arithmetic
assertion operators are unary. These operators require numeric values, and non-
numeric values are converted into numeric values by the rules described in the later
section “Casting Operators.” The arithmetic operators are:
Addition (
+
)
The result of the addition operator is the sum of the two operands.
Subtraction (
-
)
The result of the subtraction operator is the difference between the two oper-
ands; i.e., the value of the second operand subtracted from the first.
Multiplication (
*
)
The result of the multiplication operator is the product of the two operands. For
example,
3 * 4
is
12
.
Division (
/
)
The result of the division operator is the quotient of the two operands. Dividing
two integers can give an integer (e.g.,
4/2
) or a floating-point result (e.g.,
1/2
).
Modulus (
%
)
The modulus operator converts both operands to integers and returns the
remainder of the division of the first operand by the second operand. For exam-
ple,
10 % 6
is
4
.
Arithmetic negation (
-
)
The arithmetic negation operator returns the operand multiplied by –1, effec-
tively changing its sign. For example,
-(3 - 4)
evaluates to
1
. Arithmetic nega-
tion is different from the subtraction operator, even though they both are written
as a minus sign. Arithmetic negation is always unary and before the operand.
Subtraction is binary and between its operands.
Arithmetic assertion (
+
)
The arithmetic assertion operator returns the operand multiplied by +1, which
has no effect. It is used only as a visual cue to indicate the sign of a value. For
example,
+(3 – 4)
evaluates to
-1
, just as
(3 – 4)
does.

Download 6,9 Mb.

Do'stlaringiz bilan baham:
1   ...   26   27   28   29   30   31   32   33   ...   69




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish