Delphi intrinsic functions that evaluate to consts
Posted by jpluimers on 2021/02/23
A long time ago, I wondered Are these really Windows compiler unsupported Delphi Intrinsic Routines about [WayBack/Archive.is] Delphi Intrinsic Routines – RAD Studio.
Today, I limited the documented intrinsic list to the constant intrinsic functions:
const _Abs = System.Abs(1); _Chr = System.Chr(1); _Concat = System.Concat(1); _Hi = System.Hi(1); _High = System.High(1); _Length = System.Length(''); _Lo = System.Lo(1); _Low = System.Low(1); _Odd = System.Odd(1); _Ord = System.Ord(1); _Pi = System.Pi(); _Pred = System.Pred(1); _Ptr = System.Ptr(1); _Round = System.Round(1); _SizeOf = System.SizeOf(1); _Sqr = System.Sqr(1); _Succ = System.Succ(1); _Swap = System.Swap(1); _Trunc = System.Trunc(1);
The limited table is below the fold.
There is also a set of undocumented generic intrinsics that I wrote about in Source: Delphi Compiler Intrinsics can help you collapse generated code for generics a lot.
Of the those undocumented functions, these are constant intrinsic functions:
const // undocumented compiler intrinsics _Default = Default(Integer); _IsManagedType = IsManagedType(1); _GetTypeKind = GetTypeKind(1); _IsConstValue = IsConstValue(1);
–jeroen
Routine Description DCC32 DCC64 DCCOSX DCCAARM DCCIOSARM DCCIOSARM64 DCCIOS32 System.Abs Returns an absolute value. System.Chr Returns the character for a specified ASCII value. System.Concat Concatenates two or more strings into one. System.Hi Returns the high-order byte of X as an unsigned value. System.High Returns the highest value in the range of an argument. System.Length Returns the number of characters in a string or elements in an array. System.Lo Returns the low order Byte of argument X. System.Low Returns the lowest value in a range. System.Odd Returns true if argument is an odd number. System.Ord Returns the ordinal value of an ordinal-type expression. System.Pi Returns 3.1415926535897932385. System.Pred Returns the predecessor of the argument. System.Ptr Converts a specified address to a pointer. System.Round Returns the value of X rounded to the nearest whole number. System.SizeOf Returns the number of bytes occupied by a variable or type. System.Sqr Returns the square of a number. System.Succ Returns the successor of an argument. System.Swap Exchanges high order byte with the low order byte of an integer or word.
HeartWare said
Shouldn’t it be:
System.Round Returns the value of X rounded to the nearest whole EVEN number.
LEIF UNEUS said
@HeartWare,
Round uses the Banker’s rounding principle that states:
“If X is exactly halfway between two integer numbers, the result is always the even number.”