diff options
| author | Tom Lane | 2000-08-07 00:51:42 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-08-07 00:51:42 +0000 |
| commit | 9426047021651d8d7b6595c1377aef1909afcacd (patch) | |
| tree | 737356deee745db64bacbdd589f1562ec9398125 /doc/src | |
| parent | 259489bab7d01b6acc0bdc2c2938ecb22b1f5c8d (diff) | |
Clean up bogosities in use of random(3) and srandom(3) --- do not assume
that RAND_MAX applies to them, since it doesn't. Instead add a
config.h parameter MAX_RANDOM_VALUE. This is currently set at 2^31-1
but could be auto-configured if that ever proves necessary. Also fix
some outright bugs like calling srand() where srandom() is appropriate.
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/func.sgml | 12 | ||||
| -rw-r--r-- | doc/src/sgml/ref/set.sgml | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2e7144b147b..aa7e2b09898 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -171,6 +171,18 @@ <entry>convert floating point to integer</entry> <entry>integer(2.0)</entry> </row> + <row> + <entry>random()</entry> + <entry>float8</entry> + <entry>random value in the range 0.0 to 1.0</entry> + <entry>random()</entry> + </row> + <row> + <entry>setseed(float8)</entry> + <entry>int</entry> + <entry>set seed for subsequent random() calls</entry> + <entry>setseed(0.54823)</entry> + </row> </tbody> </tgroup> </table> diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index 7f36aae9d78..b76570d5def 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.46 2000/07/14 15:27:14 thomas Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.47 2000/08/07 00:51:18 tgl Exp $ Postgres documentation --> @@ -194,9 +194,9 @@ SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL <listitem> <para> The value for the seed to be used by the - <function>random</function> catalog function. Significant + <function>random</function> function. Allowed values are floating point numbers between 0 and 1, which - are then multiplied by RAND_MAX. This product will + are then multiplied by 2^31-1. This product will silently overflow if a number outside the range is used. </para> |
