Difference between revisions of "Constant"

From Free Pascal wiki
Jump to navigationJump to search
m (linkfix)
(removed unsourced claim; nicer syntax highlighting)
Line 9: Line 9:
  
 
Logical truth values
 
Logical truth values
* <code>[[False|false]]</code>
+
* [[False|<syntaxhighlight lang="pascal" enclose="none">false</syntaxhighlight>]]
* <code>[[True|true]]</code>
+
* [[True|<syntaxhighlight lang="pascal" enclose="none">true</syntaxhighlight>]]
  
 
data type limits
 
data type limits
* <code>[[Nil|nil]]</code>: empty pointer value
+
* [[Nil|<syntaxhighlight lang="pascal" enclose="none">nil</syntaxhighlight>]]: empty pointer value
* <code>[[maxint]]</code>: largest possible <code>[[Integer|integer]]</code> value
+
* [[maxint|<syntaxhighlight lang="pascal" enclose="none">maxint</syntaxhighlight>]]: largest possible [[Integer|<syntaxhighlight lang="pascal" enclose="none">integer</syntaxhighlight>]] value
  
  
The mathematical value [[Pi|π]] is realized as a function in <code>System.Pi</code>, so you may shadow (redefine) it on your own.
+
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 ==
* <code>[[Const]]</code>
+
* [[Const|<syntaxhighlight lang="pascal" enclose="none">const</syntaxhighlight>]]
 
* [[Constants]]
 
* [[Constants]]
  
 
[[Category:Constants]]
 
[[Category:Constants]]
 
[[Category:Pascal]]
 
[[Category:Pascal]]

Revision as of 18:48, 11 February 2018

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