mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:29:20 +02:00
* no SINGLE in m68k and other processors!
This commit is contained in:
parent
b5203c5b09
commit
5434ee6d4c
@ -29,6 +29,8 @@ type
|
|||||||
FileFunc = Procedure(var t : TextRec);
|
FileFunc = Procedure(var t : TextRec);
|
||||||
|
|
||||||
var
|
var
|
||||||
|
{ For Error Handling.}
|
||||||
|
DoError : Boolean;
|
||||||
ErrorBase : Longint;
|
ErrorBase : Longint;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
@ -251,6 +253,18 @@ End;
|
|||||||
|
|
||||||
{$R-}
|
{$R-}
|
||||||
|
|
||||||
|
Function Random(l : Longint) : Longint;
|
||||||
|
{
|
||||||
|
the problem Wwth this Function is if l is maxLongint*3/4 then the
|
||||||
|
probability to obtain a number in the range maxlongint*1/4 to maxlongint*1/2
|
||||||
|
is two times smaller than the probability for other numbers !
|
||||||
|
}
|
||||||
|
Begin
|
||||||
|
Randseed:=Randseed*134775813+1;
|
||||||
|
Random:=abs(Randseed mod l);
|
||||||
|
End;
|
||||||
|
|
||||||
|
|
||||||
Function Random : real;
|
Function Random : real;
|
||||||
{
|
{
|
||||||
I am not sure about the accuracy of such a value (PM)
|
I am not sure about the accuracy of such a value (PM)
|
||||||
@ -262,6 +276,8 @@ Begin
|
|||||||
Random:=(abs(Randseed)+Random)/(maxLongint+2.0);
|
Random:=(abs(Randseed)+Random)/(maxLongint+2.0);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ Include processor specific routines }
|
{ Include processor specific routines }
|
||||||
{$I math.inc}
|
{$I math.inc}
|
||||||
|
|
||||||
@ -424,7 +440,10 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 1998-07-02 09:25:05 peter
|
Revision 1.16 1998-07-02 12:11:50 carl
|
||||||
|
* no SINGLE in m68k and other processors!
|
||||||
|
|
||||||
|
Revision 1.15 1998/07/02 09:25:05 peter
|
||||||
* fixed do_error in runtimeerror
|
* fixed do_error in runtimeerror
|
||||||
|
|
||||||
Revision 1.14 1998/07/01 15:29:59 peter
|
Revision 1.14 1998/07/01 15:29:59 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user