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

« back to all changes in this revision

Viewing changes to fpcsrc/tests/test/tstrreal3.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
{ test by Graeme Geldenhuys }
 
2
 
 
3
{$mode delphi}
 
4
uses sysutils;
 
5
 
 
6
 
 
7
procedure test;
 
8
var
 
9
 Result: string;
 
10
 e: extended;
 
11
 r: double;
 
12
begin
 
13
 DecimalSeparator:='.';
 
14
 e := 234.502;
 
15
 Result := FloatToStrF(e, ffGeneral, 15, 0);
 
16
// Memo1.Lines.Add(Result);      { prints 234.502  }
 
17
 writeln(result);
 
18
 if (result <> '234.502') then
 
19
   halt(1);
 
20
 
 
21
 r := 234.502;
 
22
 Result := FloatToStrF(r, ffGeneral, 15, 0);
 
23
// Memo1.Lines.Add(Result);  { prints 234.50200000000001 }
 
24
 writeln(result);
 
25
 if (result <> '234.502') then
 
26
   halt(1);
 
27
 
 
28
 r := 234.501;
 
29
 Result := FloatToStrF(r, ffGeneral, 15, 0);
 
30
// Memo1.Lines.Add(Result);  { prints 234.501  Why does this work? }
 
31
 writeln(result);
 
32
 if (result <> '234.501') then
 
33
   halt(1);
 
34
 
 
35
 r := 7.502;
 
36
 Result := FloatToStrF(r, ffGeneral, 15, 0);
 
37
// Memo1.Lines.Add(Result);  { prints 7.502 }
 
38
 writeln(result);
 
39
 if (result <> '7.502') then
 
40
   halt(1);
 
41
 
 
42
 r := 8.502;
 
43
 Result := FloatToStrF(r, ffGeneral, 15, 0);
 
44
// Memo1.Lines.Add(Result);  { prints 8.502000000000001 }
 
45
 writeln(result);
 
46
 if (result <> '8.502') then
 
47
   halt(1);
 
48
end;
 
49
 
 
50
begin
 
51
  test;
 
52
end.