From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,SUBJ_ALL_CAPS,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,81080984e3a87d27,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-20 11:40:18 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sunqbc.risq.qc.ca!news3.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Munir Albeelbisi" Newsgroups: comp.lang.ada Subject: HOW TO FIX THIS IN ADA? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: <6Izk6.161065$Pm2.3005370@news20.bellglobal.com> Date: Tue, 20 Feb 2001 19:37:38 GMT NNTP-Posting-Host: 64.229.30.193 X-Trace: news20.bellglobal.com 982697858 64.229.30.193 (Tue, 20 Feb 2001 14:37:38 EST) NNTP-Posting-Date: Tue, 20 Feb 2001 14:37:38 EST Organization: Sympatico Xref: supernews.google.com comp.lang.ada:5378 Date: 2001-02-20T19:37:38+00:00 List-Id: with Ada.Text_IO; use Ada.Text_IO; PROCEDURE Random(Output) IS ; seed1 = 5; seed2 = 10000; seed3 = 3000; x, y, z : integer; looop : integer; FUNCTION Unif return real is tmp : real; Begin x := 171*(x mod 177) - 2*(x div 177); if x<0 then x := x + 30269; y := 172*(y mod 176) -35*(y div 176); if y<0 then y := y + 30307; z := 170*(z mod 178) -63*(z div 178); if z<0 then z := z + 30323; tmp := x/30269.0 + y/30307.0 + z/30323.0; Unif := tmp - trunc(tmp); End; {Unif} BEGIN x := seed1; y := seed2; z := seed3; for looop := 1.. 1000 loop writeln(loop:4, ' ==> ', unif:7:5); END loop; END unif;