Merge branch 'master' of https://github.com/pascalabcnet/pascalabcnet
This commit is contained in:
commit
333201895f
|
|
@ -96,7 +96,7 @@
|
|||
<p><code><strong>var</strong> a := Arr(1,3,5,7,8);
|
||||
// array of integer<br><strong>var</strong> s :=
|
||||
Arr('Иванов','Петров','Сидоров'); // array of string<br><strong>var</strong>
|
||||
b := ArrFill(777,5);
|
||||
b := ArrFill(5,777);
|
||||
// b = [777,777,777,777,777]<br><strong>var</strong> r := ArrRandom(10);
|
||||
// заполнение 10 случайными целыми в диапазоне от 0 до 100 </code></p>
|
||||
</blockquote>
|
||||
|
|
|
|||
|
|
@ -1777,7 +1777,7 @@ function Sign(x: real): integer;
|
|||
///--
|
||||
function Sign(x: BigInteger): integer;
|
||||
///-function Abs(x: число): число;
|
||||
/// Возвращает модуль числа x
|
||||
/// Возвращает модуль числа
|
||||
function Abs(x: shortint): shortint;
|
||||
///--
|
||||
function Abs(x: smallint): smallint;
|
||||
|
|
|
|||
|
|
@ -91,12 +91,25 @@ function !format(val: real; fmt: string): string;
|
|||
|
||||
//function any<T>(seq: sequence of T): boolean;
|
||||
|
||||
// Standard Math functions
|
||||
//------------------------------------
|
||||
// Standard Math functions
|
||||
//------------------------------------
|
||||
|
||||
/// Возвращает абсолютное значение числа
|
||||
function abs(x: integer): integer;
|
||||
|
||||
/// Возвращает абсолютное значение числа
|
||||
function abs(x: real): real;
|
||||
|
||||
/// Возвращает результат и остаток от целочисленного деления
|
||||
function divmod(a,b: integer): (integer,integer);
|
||||
|
||||
/// Возвращает x в степени y
|
||||
function pow(x,y: real): real;
|
||||
/// Возвращает x в целой степени n
|
||||
function pow(x: real; n: integer): real;
|
||||
/// Возвращает x в целой степени n
|
||||
function pow(x: BigInteger; n: integer): BigInteger;
|
||||
|
||||
// function floor(x: real): real;
|
||||
|
||||
type list<T> = class(IEnumerable<T>)
|
||||
|
|
@ -651,10 +664,23 @@ end;
|
|||
|
||||
//function any<T>(seq: sequence of T): boolean := seq.Any(x -> x);
|
||||
|
||||
function abs(x: integer): integer := if x >= 0 then x else -x;
|
||||
//------------------------------------
|
||||
// Standard Math functions
|
||||
//------------------------------------
|
||||
|
||||
function abs(x: integer): integer := if x >= 0 then x else -x;
|
||||
function abs(x: real): real := PABCSystem.Abs(x);
|
||||
|
||||
function divmod(a,b: integer): (integer,integer)
|
||||
:= (a div b, a mod b);
|
||||
// divmod вещественный аналог надо реализовать на питоне бы
|
||||
|
||||
function pow(x,y: real): real := PABCSystem.Power(x,y);
|
||||
|
||||
function pow(x: real; n: integer): real := PABCSystem.Power(x,n);
|
||||
|
||||
function pow(x: BigInteger; n: integer): BigInteger := PABCSystem.Power(x,n);
|
||||
|
||||
function len<T>(lst: list<T>): integer := lst.!count;
|
||||
function len<T>(st: &set<T>): integer := st.!count;
|
||||
function len<K, V>(dct: dict<K, V>): integer := dct.!count;
|
||||
|
|
|
|||
|
|
@ -15,4 +15,7 @@ def print(*args: obj, **kwargs: str):
|
|||
|
||||
if len(args) != 0:
|
||||
pas_print(args[len(args) - 1])
|
||||
pas_print(end)
|
||||
pas_print(end)
|
||||
|
||||
#def divmod(a: int, b: int) -> (int,int)
|
||||
# := (a // b, a % b);
|
||||
|
|
|
|||
Loading…
Reference in a new issue