From a113a66a7a7dc28d176663067b5edc9065de2c71 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 20 Jan 2015 21:21:47 -0500 Subject: [PATCH] Improve documentation of random() function. Move random() and setseed() to a separate table, to have them grouped together. Also add a notice that random() is not cryptographically secure. Back-patch of commit 75fdcec14543b60cc0c67483d8cc47d5c7adf1a8 into all supported versions, per discussion of the need to document that random() is just a wrapper around random(3). --- doc/src/sgml/func.sgml | 73 +++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 23 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2d6f500b4c..71bdfb09cd 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -650,15 +650,9 @@ radians - - random - round - - setseed - sign @@ -819,14 +813,6 @@ 0.785398163397448 - - random() - dp - random value in the range 0.0 <= x < 1.0 - random() - - - round(dp or numeric) (same as input) @@ -843,15 +829,6 @@ 42.44 - - setseed(dp) - void - set seed for subsequent random() calls (value between -1.0 and - 1.0, inclusive) - setseed(0.54823) - - - sign(dp or numeric) (same as input) @@ -907,6 +884,56 @@ + + shows functions for + generating random numbers. + + + + Random Functions + + + + + Function + Return Type + Description + + + + + + + random + + random() + + dp + random value in the range 0.0 <= x < 1.0 + + + + + + setseed + + setseed(dp) + + void + set seed for subsequent random() calls (value between -1.0 and + 1.0, inclusive) + + + +
+ + + The characteristics of the values returned by + random() depend + on the system implementation. It is not suitable for cryptographic + applications; see module for an alternative. + + Finally, shows the available trigonometric functions. All trigonometric functions -- 2.40.0