
Code: Alles auswählen
Procedure.q RandomQ( RangeH.q )
Protected ResultH.q
Protected ResultM.q
Protected ResultL.q
Protected RangeM.q
Protected RangeL.q
Protected Sign.q = 1
If RangeH < 0
RangeH = -RangeH
Sign = -1
EndIf
If RangeH > 2147483647
RangeL = RangeH & $FFFF
RangeM = ( RangeH & $FFFF0000 ) >> 16
RangeH >> 32
ResultH = Random( RangeH )
If ResultH = RangeH
ResultM = Random( RangeM )
If ResultM = RangeM
ResultL = Random( RangeL )
Else
ResultL = Random( $FFFF )
EndIf
Else
ResultM = Random( $FFFF )
ResultL = Random( $FFFF )
EndIf
ResultH = (ResultH << 32) + (ResultM << 16) + ResultL
Else
ResultH = Random( RangeH )
EndIf
ResultH * Sign
ProcedureReturn ResultH
EndProcedure
(und außer ich hab nen blöden typo irgendwo übersehen...)