Re: [fpc-pascal] Can class function used in specialized class use intristic functions Low, High with generic type ?

2017-04-21 Thread Cyrax
On 20.04.2017 14:37, Sven Barth via fpc-pascal wrote: Am 20.04.2017 13:02 schrieb "LacaK" : Hi *, I have some generic class: generic T2DNumericArray = object(specialize T2DArray) public class function Truncate(Value: double): T; inline; ... In class function Truncate I wan

Re: [fpc-pascal] 32-bit random numbers

2017-04-21 Thread Mark Morgan Lloyd
On 21/04/17 17:00, Peter wrote: On 21/04/17 10:11, Mark Morgan Lloyd wrote:> Am I correct in interpreting the documentation as implying that if I> want to get a full-range 32-bit unsigned random number I have to use> something like Random($1) ?> > Internally, that gets a 64-bit random b

Re: [fpc-pascal] 32-bit random numbers

2017-04-21 Thread Peter
On 21/04/17 10:11, Mark Morgan Lloyd wrote: > Am I correct in interpreting the documentation as implying that if I > want to get a full-range 32-bit unsigned random number I have to use > something like Random($1) ? > > Internally, that gets a 64-bit random by calling genrand_MT19937 twice

Re: [fpc-pascal] Can class function used in specialized class use intristic functions Low, High with generic type ?

2017-04-21 Thread LacaK
> > I have some generic class: > > generic T2DNumericArray = object(specialize T2DArray) > public > class function Truncate(Value: double): T; inline; > ... > > In class function Truncate I want check if supplied Value is in range of T. > T will be always ordinal type (byte, int

[fpc-pascal] 32-bit random numbers

2017-04-21 Thread Mark Morgan Lloyd
Am I correct in interpreting the documentation as implying that if I want to get a full-range 32-bit unsigned random number I have to use something like Random($1) ? Internally, that gets a 64-bit random by calling genrand_MT19937 twice and throwing away one of the results. Not only do