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

« back to all changes in this revision

Viewing changes to docs/mathex/ex26.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 Example26;
2
 
 
3
 
{ Program to demonstrate the MaxValue function. }
4
 
 
5
 
{ Make sore integer is 32 bit}
6
 
{$mode objfpc}
7
 
 
8
 
Uses math;
9
 
 
10
 
Type
11
 
  TExFloatArray = Array[1..100] of Float;
12
 
  TExIntArray = Array[1..100] of Integer;
13
 
    
14
 
Var
15
 
  I : Integer;
16
 
  ExFloatArray : TExFloatArray; 
17
 
  ExIntArray : TExIntArray; 
18
 
  AFLoatArray : PFLoat;
19
 
  AIntArray : PInteger;    
20
 
begin
21
 
  Randomize;
22
 
  AFloatArray:=@ExFloatArray[1];
23
 
  AIntArray:=@ExIntArray[1];
24
 
  for I:=1 to 100 do 
25
 
    ExFloatArray[i]:=(Random-Random)*100;
26
 
  for I:=1 to 100 do 
27
 
    ExIntArray[i]:=Random(I)-Random(100);
28
 
  Writeln('Max Float       : ',MaxValue(ExFloatArray):8:4);  
29
 
  Writeln('Max Float   (b) : ',MaxValue(AFloatArray,100):8:4);
30
 
  Writeln('Max Integer     : ',MaxValue(ExIntArray):8);  
31
 
  Writeln('Max Integer (b) : ',MaxValue(AIntArray,100):8);  
32
 
end.