, . , , , . .
. ( Delphi ) .
:
Int64 , 263 +263-1, 8 ;
Integer , 2147483648 +2147483647, 4 ;
LongInt , Integer;
SmallInt , 32768 +32767, 2 ;
ShortInt , 128 +127, 1 ;
Byte , 0 255, 1 ;
Word , 0 65535 2 ;
LongWord , 0 4294967295, 4 ;
Cardinal , LongWord.
, I K Integer N Byte,
var
I, K:Integer; // I K Integer
N:Byte // N Byte
, . + . , +25 25 . , .
( ) const, =, ,
const
Nmax=10; // Nmax
, , , :
( +),
( -),
( -),
( *),
( div),
( mod).
div , mod ( ). , 5 div -2 2, -5 mod 2 1.
( /), . , 5/-2 2,5.
|
|
() , . ,
type
tBall = 2..5; // tBall
tIndex = 1..10; // tIndex
tBall 2 5 tIndex 1 10. , , , .
() :
Extended , 19 20 3,6ּ10-4951 1,1 ּ10+4932, 10 ;
Double , 15 16 5ּ10-324 1,7ּ10+308, 8 ;
Real , Double;
Real48 , 11 12 2,9ּ10-39 1,7ּ10+38, 6 ;
Single , 7 8 1,5ּ10-45 3,4ּ10+38, 4 ;
Comp , 19 20 -263+1 +263-1, 8 ;
Currency , 19 20 -922337203685477,5808 +922337203685477,5807, 8 ;
, ,
-12.345, , , , -0.12345E+2, -0.12345E2, -0.12345+2, 1.2345E+1, 1.2345E1, 12.345E0, 1234.5E-2, 12345E-3, . , . , , , , , , 10 , , . , -0.12345E+2 0,1234510+2, -1234.5E-2 1234,510-2.
Y Real, Z Extended H 0,00000025:
var
X, Y: Real;
Z: Extended;
const
H = 2.5E-7;
, , , :
( +),
( -),
( -),
( *),
( /).
BASIC Fortran, Object Pascal .
, , , System, , Math.
|
|
, ( , , , ) .
, , , :
Abs(X) ,
Sqr(X)
Max(X,Y) X Y,
Min(X,Y) X Y.
, ( , ) :
Tan(X) ,
ArcTan(X) ,
Sin(X) ,
ArcSin(X) ,
Cos(X) ,
ArcCos(X) ,
Exp(X) ex,
Frac(X) ,
Int(X) ,
Ln(X) ,
Log10(X) X 10,
LogN(N,X) X N,
Pi p,
Sqrt(X) ,
IntPower(X,N) X, N,
Power(X,Y) X, Y ( Y , X ).
, :
Round(X) ,
Trunc(X) ,
Sign(X) 1 X>0, 0 X=0, -1 X<0.
System Math Delphi Arithmetic routines Trigonometry routines.
, , . , ( ).
, , /, .
, (*, /, div, mod) , (+ -) .
,
Sqr(Sin(X))*Cos(IntPower(Y,3))*1.2E-4/Sqrt(X)/Y/Power(Z,2/3).
, ( , ).
:
, := ( ), , , , , , . ,
X:=5 mod 2;
: 5 mod 2 , 1, , .
|
|
. . , , . Round Trunc. , K
K:=Round(5.6); // K 6
K:=Trunc(5.6); // K 5,
K:=5.6;
Read ReadLn ( Read ReadLn). , , , . , . , , , ( TAB), ( Enter). Enter. . , . , Read, , Enter.
, X Y Read(X,Y) , :
5.21 1e-3¿
:
5.21¿
1e-3¿
¿ Enter.
:
Read(X); Read(Y);
.
ReadLn Read , ( ). ,
ReadLn(X); ReadLn(Y);
, .