Numeric separator syntax: Difference between revisions
Pascal entry
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(Pascal entry) |
||
Line 373:
Printf.printf "%f\n" 1234._25;; (* 1234.250000 *)
Printf.printf "%f\n" 1234.25_;; (* 1234.250000 *)</syntaxhighlight>
=={{header|Pascal}}==
Works with FPC (currently only version 3.3.1).
An underscore can be used as a digit separator. This is by default in {$mode delphi}, in other modes it is activated using the {$modeswitch underscoreisseparator}.
<syntaxhighlight lang="pascal">
program test;
{$mode fpc}
{$modeswitch underscoreisseparator}
begin
WriteLn(%1001_1001);
WriteLn(&121_102);
WriteLn(-1_123_123);
WriteLn($1_123_123);
WriteLn(-1_123___123.000_000);
WriteLn(1_123_123.000_000e1_2);
end.
</syntaxhighlight>
=={{header|Perl}}==
|