Files
harbour-core/contrib/hbtinymt/tests/test64.prg
Przemysław Czerpak 96ca3fe470 2014-01-21 20:41 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* Makefile
  * config/*
  * contrib/*
  * doc/*
  * extras/*
  * include/*
  * lib/*
  * package/*
  * src/*
  * tests/*
  * utils/*
    * removed empty lines left after removed '$' + 'Id' + '$' identifiers
2014-01-21 20:41:05 +01:00

37 lines
1.0 KiB
Plaintext

#require "hbtinymt"
PROCEDURE Main()
SET DECIMAL TO 0
IF tinymt64_init( 0x123, 0x234, 0x345 )
TestMatrix( "64-bit unsigned integers r, where 0 <= r < 2^64", {|| PadL( tinymt64_generate_uint64(), 22 ) } )
ENDIF
SET DECIMAL TO 22
IF tinymt64_init_by_array( { 0x123, 0x234, 0x345 } )
TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt64_generate_double(), 30 ) } )
TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt64_generate_double01(), 30 ) } )
TestMatrix( "Double numbers r, where 1.0 <= r < 2.0", {|| PadL( tinymt64_generate_double12(), 30 ) } )
TestMatrix( "Double numbers r, where 0.0 < r <= 1.0", {|| PadL( tinymt64_generate_doubleOC(), 30 ) } )
TestMatrix( "Double numbers r, where 0.0 < r < 1.0", {|| PadL( tinymt64_generate_doubleOO(), 30 ) } )
ENDIF
RETURN
STATIC PROCEDURE TestMatrix( cDescription, bBlock )
LOCAL i, j
? cDescription
FOR i := 1 TO 10
FOR j := 1 TO 5
? Eval( bBlock )
NEXT
?
NEXT
?
RETURN