Subversion Repositories Kolibri OS

Rev

Rev 8859 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9893 akron1 1
(* ****************************************
2
   Дополнение к модулю Math.
3
   Побитовые операции над целыми числами.
4
   Вадим Исаев, 2020
5
   Additional functions to the module Math.
6
   Bitwise operations on integers.
7
   Vadim Isaev, 2020
8
******************************************* *)
9
 
10
MODULE MathBits;
11
 
12
 
13
PROCEDURE iand* (x, y: INTEGER): INTEGER;
14
    RETURN ORD(BITS(x) * BITS(y))
15
END iand;
16
 
17
 
18
PROCEDURE ior* (x, y: INTEGER): INTEGER;
19
    RETURN ORD(BITS(x) + BITS(y))
20
END ior;
21
 
22
 
23
PROCEDURE ixor* (x, y: INTEGER): INTEGER;
24
    RETURN ORD(BITS(x) / BITS(y))
25
END ixor;
26
 
27
 
28
PROCEDURE inot* (x: INTEGER): INTEGER;
29
    RETURN ORD(-BITS(x))
30
END inot;
31
 
32
 
33
END MathBits.