
Округляет вещественное число X до ближайшего целого, в большую сторону.
Example as TechEditor Pascal Script (.PSC):
begin
V1 := Math.Ceil(4.2); // V1=5
V2 := Math.Ceil(4.6); // V2=5
V3 := Math.Ceil(-4.2); // V3=-4 V4 := Math.Ceil(-4.6); // V4=-4 end;
🛈 This routine has a similar routine in the Math unit (specify the Math unit in the uses list):
function Ceil(X): Double;
Округляет вещественное число X до ближайшего целого, в меньшую сторону.
Example as TechEditor Pascal Script (.PSC):
begin
V1 := Math.Floor(4.2); // V1=4
V2 := Math.Floor(4.6); // V2=4
V3 := Math.Floor(-4.2); // V3=-5
V4 := Math.Floor(-4.6); // V4=-5
end;
🛈 This routine has a similar routine in the Math unit (specify the Math unit in the uses list):
function Floor(X): Double;
Returns the fractional part of a real number X.
Example as TechEditor Pascal Script (.PSC):
begin
X := Math.Frac(4.26); // X=0.26
end;
🛈 This routine has a similar system routine:
function Frac(X): Double;
Возвращает целую часть вещественного числа X. Дробная часть числа X отсекается.
Example as TechEditor Pascal Script (.PSC):
begin
V1 := Math.Int(4.2); // V1=4
V2 := Math.Int(-4.2); // V2=-4
end;
🛈 This routine has a similar system routine:
function Int(X): Double;
Округляет вещественное число X.
Example as TechEditor Pascal Script (.PSC):
begin
V1 := Math.Round(2.2); // V1=2
V2 := Math.Round(2.6); // V2=3
V3 := Math.Round(-2.2); // V3=-2 V4 := Math.Round(-2.6); // V4=-3 end;
🛈 This routine has a similar system routine:
function Round(X): Double;
Округляет вещественное число x до десятичного знака Digit по правилам "банковского округления". Аргумент Digit должен иметь значение от -20 до 20. Функция находится в модуле Math.
⚠️ Warning! The result of this function on different computers may be different.
Example as TechEditor Pascal Script (.PSC):
uses Math;
begin
V1 := RoundTo(1234567, 3); // V1=1235000
V2 := RoundTo(1.234, -2); // V2=1.23
V3 := RoundTo(1.235, -2); // V3=1.24 V4 := RoundTo(1.245, -2); // V4=1.25 end;
Округляет вещественное число x до десятичного знака Digit по правилам "симметричного арифметического округления". Аргумент Digit должен иметь значение от -37 до 37. Функция находится в модуле Math.
⚠️ Warning! The result of this function on different computers may be different.
Example as TechEditor Pascal Script (.PSC):
uses Math;
begin
V1 := SimpleRoundTo(1234567, 3); // V1=1235000
V2 := SimpleRoundTo(1.234, -2); // V2=1.23
V3 := SimpleRoundTo(1.235, -2); // V3=1.24 V4 := SimpleRoundTo(-1.235, -2); // V4=-1.24 end;
Преобразует вещественное число X в целочисленное, путем отсечения дробной части.
Example as TechEditor Pascal Script (.PSC):
begin
V1 := Math.Trunc(2.25); // V1=2
V2 := Math.Trunc(2.77); // V2=2
V3 := Math.Trunc(-2.25); // V3=-2 V4 := Math.Trunc(-2.77); // V4=-2 end;
🛈 This routine has a similar system routine:
Abs AbsInt Add AnsiCompareStr AnsiCompareText AnsiLowerCase AnsiUpperCase ArcCos ArcCosH ArcCot ArcCotH ArcCsc ArcCscH ArcSec ArcSecH ArcSin ArcSinH ArcTan ArcTan2 ArcTanH Calculate CalculateStr Ceil Chr Clear CompareStr CompareText Convert ConvertStr Copy cos Cosecant CosH Cot Cotan CotH Csc CscH CycleToDeg CycleToGrad CycleToRad Dec DegToCycle DegToGrad DegToRad Delete diagram DivMod document explorer Exp FloatToStr Floor flowchart Format Frac GradToCycle GradToDeg GradToRad Hypot Inc install Int IntPower IntToStr IsInfinite IsNaN IsZero LaTeX Length LInterp Ln LnXP1 Log10 Log2 LogN LowerCase MathTranslator Max MaxInt Min MinInt move number Odd Ord pan Pi Pos Power Power2 Power3 Power4 RadToCycle RadToDeg Random report Root2 Root3 Root4 Round RoundTo Sec Secant SecH section Sign SimpleRoundTo sin SinH Sqrt StrToFloat StrToFloatDef StrToInt StrToIntDef Tan TanH Trim TrimLeft TrimRight Trunc UML Units UpperCase
Dystlab™. All rights reserved.
Ukraine, 76006, Ivano-Frankivsk.
E-mail:
technot needed texteditoranother not needed text@dystlabdummy text.store
Telegram:
https://t.me/techeditor
Dystlab™ is a trademark registered in the State Register of Certificates of Ukraine for Goods and Services Marks 26.02.2018, certificate No. 238304. Owner: entepreneur Artomov V.E., EGRPOU/ITN: 3003314690.