Difference between revisions of "period"

From Free Pascal wiki
Jump to navigationJump to search
(→‎radix mark: wording)
Line 8: Line 8:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
At least one digit in front of the period is mandatory.
 
At least one digit in front of the period is mandatory.
A <syntaxhighlight lang="pascal" enclose="none">0</syntaxhighlight> integer part can not be left out.
+
A <syntaxhighlight lang="pascal" enclose="none">0</syntaxhighlight> integer part must not be omitted.
  
 
Numbers noted in a non-decimal base can not be noted in that way.
 
Numbers noted in a non-decimal base can not be noted in that way.

Revision as of 14:49, 25 March 2018

English (en) suomi (fi) français (fr)

radix mark

Pascal uses the . (dot) to separate the integer and fractional part in literal decimal integers.

myReal := 6.28318

At least one digit in front of the period is mandatory. A 0 integer part must not be omitted.

Numbers noted in a non-decimal base can not be noted in that way. E.g. a half can not be written as %0.1 (% being the prefix marking binary numbers).

identifier scope selector

For structured data types the dot separates the data structure identifier from its individual components, i.e. methods or data fields.

 1program recordDemo(input, output, stderr);
 2
 3uses
 4	Linux;
 5
 6var
 7	info: TSysInfo;
 8begin
 9	if sysInfo(@info) <> 0 then
10	begin
11		halt(1);
12	end;
13	
14	writeLn('uptime: ', info.uptime, ' seconds');
15	
16	with info do
17	begin
18		writeLn('total free: ', freeram, ' bytes');
19	end;
20end.

range

Two consecutive dots .. let you specify an integer sub-range.

type
	signumCodomain = -1..1;


navigation bar: topic: Pascal symbols
single characters

+ (plus)  •  - (minus)  •  * (asterisk)  •  / (slash)
= (equal)  •  > (greater than)  •  < (less than)
. (period)  •  : (colon)  •  ; (semi colon)
^ (hat)  •  @ (at)
$ (dollar sign)  •  & (ampersand)  •  # (hash)
' (single quote)

character pairs

<> (not equal)  •  <= (less than or equal)  •  := (becomes)  •  >= (greater than or equal)

 •  >< (symmetric difference)  •  // (double slash)