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

« back to all changes in this revision

Viewing changes to fpcdocs/mathex/ex31.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 Example31;
 
2
 
 
3
{ Program to demonstrate the MinValue function. }
 
4
 
 
5
{ Make sure integer is 32 bit}
 
6
{$mode objfpc}
 
7
 
 
8
uses math;
 
9
 
 
10
var i:1..100;
 
11
    f_array:array[1..100] of Float;
 
12
    i_array:array[1..100] of Integer;
 
13
    Pf_array:Pfloat;
 
14
    PI_array:Pinteger;
 
15
 
 
16
begin
 
17
  randomize;
 
18
 
 
19
  Pf_array:=@f_array[1];
 
20
  Pi_array:=@i_array[1];
 
21
 
 
22
  for i:=low(f_array) to high(f_array) do
 
23
    f_array[i]:=(random-random)*100;
 
24
  for i:=low(i_array) to high(i_array) do
 
25
    i_array[i]:=random(I)-random(100);
 
26
 
 
27
  Writeln('Min Float       : ',MinValue(f_array):8:4);
 
28
  Writeln('Min Float   (b) : ',MinValue(Pf_array,100):8:4);
 
29
  Writeln('Min Integer     : ',MinValue(i_array):8);
 
30
  Writeln('Min Integer (b) : ',MinValue(Pi_array,100):8);
 
31
end.