Difference between revisions of "Constant"
From Free Pascal wiki
Jump to navigationJump to search (→See also: Add link to Class Constants) |
|||
Line 9: | Line 9: | ||
Logical truth values | Logical truth values | ||
− | * [[False|<syntaxhighlight lang="pascal" | + | * [[False|<syntaxhighlight lang="pascal" inline>false</syntaxhighlight>]] |
− | * [[True|<syntaxhighlight lang="pascal" | + | * [[True|<syntaxhighlight lang="pascal" inline>true</syntaxhighlight>]] |
data type limits | data type limits | ||
− | * [[Nil|<syntaxhighlight lang="pascal" | + | * [[Nil|<syntaxhighlight lang="pascal" inline>nil</syntaxhighlight>]]: empty [[Pointer|pointer]] value |
− | * [[maxint|<syntaxhighlight lang="pascal" | + | * [[maxint|<syntaxhighlight lang="pascal" inline>maxint</syntaxhighlight>]]: largest possible [[Integer|<syntaxhighlight lang="pascal" inline>integer</syntaxhighlight>]] value |
− | The mathematical value [[Pi|π]] is realized as a function in {{Doc|package=RTL|unit=system|identifier=pi|text=<syntaxhighlight lang="pascal" | + | The mathematical value [[Pi|π]] is realized as a function in {{Doc|package=RTL|unit=system|identifier=pi|text=<syntaxhighlight lang="pascal" inline>system.pi</syntaxhighlight>}}. |
== See also == | == See also == | ||
− | * [[Const|<syntaxhighlight lang="pascal" | + | * [[Const|<syntaxhighlight lang="pascal" inline>const</syntaxhighlight>]] |
* [[Constants]] | * [[Constants]] | ||
* [[Class constants]] | * [[Class constants]] |
Revision as of 17:21, 6 August 2022
│
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
.