Difference between revisions of "Constant"

From Lazarus wiki
Jump to navigationJump to search
(→‎See also: Add link to Class Constants)
Line 19: Line 19:
 
The mathematical value [[Pi|π]] is realized as a function in {{Doc|package=RTL|unit=system|identifier=pi|text=<syntaxhighlight lang="pascal" enclose="none">system.pi</syntaxhighlight>}}.
 
The mathematical value [[Pi|π]] is realized as a function in {{Doc|package=RTL|unit=system|identifier=pi|text=<syntaxhighlight lang="pascal" enclose="none">system.pi</syntaxhighlight>}}.
  
== see also ==
+
== See also ==
 
* [[Const|<syntaxhighlight lang="pascal" enclose="none">const</syntaxhighlight>]]
 
* [[Const|<syntaxhighlight lang="pascal" enclose="none">const</syntaxhighlight>]]
 
* [[Constants]]
 
* [[Constants]]
 +
* [[Class constants]]

Revision as of 07:15, 9 August 2020

English (en) suomi (fi) français (fr) русский (ru) 中文(中国大陆)‎ (zh_CN)

A constant is a variable that does not change, it has a final value.

Constants are defined in the const section of a Free Pascal program. When a symbol is defined as constant, the Free Pascal compiler can often do some optimizations to make the output code faster or smaller.


Some special Free Pascal constants are:

Logical truth values

data type limits


The mathematical value π is realized as a function in system.pi.

See also