~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcdocs/sysutex/ex69.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Program Example68;
 
2
 
 
3
{ This program demonstrates the FloatToStrF function }
 
4
 
 
5
Uses sysutils;
 
6
 
 
7
Const Fmt : Array [TFloatFormat] of string[10] =
 
8
         ('general','exponent','fixed','number','Currency');
 
9
 
 
10
Procedure Testit (Value :  Extended);
 
11
 
 
12
Var I,J : longint;
 
13
    FF : TFloatFormat;
 
14
    S : ShortString;
 
15
 
 
16
begin
 
17
  For I:=5 to 15 do
 
18
    For J:=1 to 4 do
 
19
      For FF:=ffgeneral to ffcurrency do
 
20
        begin
 
21
        Write (Value,'(Prec: ',I:2,', Dig: ',J,', fmt : ',Fmt[ff],') : ');
 
22
        SetLength(S,FloatToText (@S[1],Value,FF,I,J));
 
23
        Writeln (S);
 
24
        Write (-Value,'(Prec: ',I:2,', Dig: ',J,', fmt : ',Fmt[ff],') : ');
 
25
        SetLength(S,FloatToText (@S[1],-Value,FF,I,J));
 
26
        Writeln (S);
 
27
        end;
 
28
end;
 
29
 
 
30
Begin
 
31
  Testit (1.1);
 
32
  Testit (1.1E1);
 
33
  Testit (1.1E-1);
 
34
  Testit (1.1E5);
 
35
  Testit (1.1E-5);
 
36
  Testit (1.1E10);
 
37
  Testit (1.1E-10);
 
38
  Testit (1.1E15);
 
39
  Testit (1.1E-15);
 
40
  Testit (1.1E100);
 
41
  Testit (1.1E-100);
 
42
End.
 
 
b'\\ No newline at end of file'