Subject how random is rand() ?
Author duilio_fos
enclosed are the results I got by the following SQL code:

SELECT rand()*100 FROM rdb$database

50.26
50.48
50.64
50.79
50.92
51.06

(only 2 decimals are written here)

Given the definition of the rand() function, I was expecting random
values 0<=V<100 .

What I got are similar, slightly increasing values. Surely not random
values.

Am I bad or is the rand() function bad ?

TIA

Duilio Foschi

PS I am using FB v. 1.0 .

The rand() function is declared as

DECLARE EXTERNAL FUNCTION rand
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_rand' MODULE_NAME 'ib_udf';