Please enable JavaScript to view this site.

KOL/MCK - User Guide

I64 vs Int64

 

Delphi, starting with version 5, introduced the Int64 data type for working with 8-byte integers. But earlier versions of Delphi did not have this data type. In order to be able to work with them in older versions of Delphi, KOL introduces its own I64 data type and has developed a set of functions for working with this data type:

 

MakeInt64(lo, hi ): I64 - generates a long integer from two ordinary integers;

Int2Int64(i): I64 - "converts" an integer data type to a long integer (equivalent to calling MakeInt64 (i, 0));

IncInt64(I, delta) - increases I: I64 by an integer delta;

DecInt64(I, delta) - decreases I: I64 by delta;

Add64(I1, I2) - adds two numbers like I64;

Sub64(I1, I2) - subtracts I2 from I1;

Neg64(I) - returns -I;

Mul64i(I, i) - multiplies the doubled integer I by the usual integer i;

Div64i(I, i) - divides a doubled whole into an ordinary whole;

Mod64i(I, i) - calculates the remainder of dividing I by i;

Sgn64i(I) - returns the "sign" of the number I (ie -1 if I is negative, 0 if I = 0, or 1 if I> 0);

Cmp64(I1, I2) - compares two doubled integers (also returns -1, 0, 1, depending on whether the first parameter of the second is less, they are equal or the first is greater than the second);

Int64_2Str(I) - converts a doubled integer to a string;

Str2Int64(s) - converts a number in string representation to a doubled integer;

Int64_2Double(I) - converts a doubled integer to a floating point number;

Double2Int64(d) - converts a floating point number to a double integer.

 

Nobody bothers, however, to use the Int64 data type built into Delphi of lower versions, but to convert such numbers to a string and back, I still recommend using the Int64_2Str, Str2Int64 functions, performing the appropriate data type conversions.

The use of the other above functions only makes sense if the project is being developed in Delphi 3 or 2.

 

 

Floating Point conversions. Floating Point math

 

In order to avoid the need to include the SysUtils module, a set of functions has been introduced in KOL to convert floating point numbers to a string and vice versa. (Normal floating point operations do not require special functions or the connection of the SysUtils module). These are the following functions: Str2Double (s), Double2Str (d), Str2Extended (s), Extended2Str (e).

 

In addition, KOL includes a couple of functions from the section of mathematics that are used in itself, these are IntPower (i, n), and IsNAN (d), as well as the constant NAN, which denotes an impossible floating point number (equal to 0/0 uncertainty) ...

 

Other mathematical functions (trigonometry, logarithms, finding the maximum, minimum number in an array, summation, static and economic functions), similar to the standard ones, are moved to a separate module kolmath.pas (when it is turned on, the err.pas module is also added to the project, which is used to support exception handling, and increases the weight of the application by about 6KB).

 

KOL / MCK User Guide - Created by Carl Peeraer - Diamant Soft, based on the work of Vladimir Kladov - Artwerp.be

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Nav Header: ALT+n
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Exit Menu/Up: ESC