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

« back to all changes in this revision

Viewing changes to fpcsrc/tests/webtbs/tw3157.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
{ Source provided for Free Pascal Bug Report 3157 }
 
2
{ Submitted by "Michalis Kamburelis" on  2004-06-11 }
 
3
{ e-mail: michalis@camelot.homedns.org }
 
4
 
 
5
{$mode objfpc}
 
6
 
 
7
uses SysUtils, Math;
 
8
 
 
9
var
 
10
  c:Single;
 
11
  temp_float:double;
 
12
  temp_int:Integer;
 
13
  notcaught: integer;
 
14
begin
 
15
 notcaught := 2;
 
16
 SetExceptionMask(GetExceptionMask - [exOverflow,exUnderflow,exPrecision]);
 
17
 try
 
18
  { cosh(800) =~ 1.36E+0347, this will fit in Extended but will
 
19
    not fit in Single or Double.
 
20
    So instruction below should raise Floating point overflow.
 
21
    But it does not (yet). }
 
22
  c:=cosh(800);  
 
23
 except
 
24
  on E:Exception do
 
25
    begin
 
26
      Writeln('Line "c:=..." raised ' +E.ClassName+ ': ' +E.Message);
 
27
      dec(notcaught);
 
28
    end;
 
29
 end;
 
30
 
 
31
 temp_float:=9/200;
 
32
 try
 
33
  { This innocent instruction will raise EOverflow exception.
 
34
 
 
35
    Note: if this will be changed to "Round(9/200)" then
 
36
    this whole program will run with no exception
 
37
    (I guess that it's because "Round(9/200)" will be calculated
 
38
    at compile-time). }
 
39
  temp_int:=Round(temp_float);
 
40
 except
 
41
  on E:Exception do
 
42
   begin
 
43
     Writeln('Line "temp_int:=..." raised ' +E.ClassName+ ': ' +E.Message);
 
44
     dec(notcaught);
 
45
   end;
 
46
 end;
 
47
 halt(notcaught);
 
48
end.