<parameter>max</parameter>, whichever has more.
</para>
<para>
<literal>random(1, 10)</literal>
<returnvalue>7</returnvalue>
</para>
<para>
<literal>random(-0.499, 0.499)</literal>
<returnvalue>0.347</returnvalue>
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>random_normal</primary>
</indexterm>
<function>random_normal</function> (
<optional> <parameter>mean</parameter> <type>double precision</type>
<optional>, <parameter>stddev</parameter> <type>double precision</type> </optional></optional> )
<returnvalue>double precision</returnvalue>
</para>
<para>
Returns a random value from the normal distribution with the given
parameters; <parameter>mean</parameter> defaults to 0.0
and <parameter>stddev</parameter> defaults to 1.0
</para>
<para>
<literal>random_normal(0.0, 1.0)</literal>
<returnvalue>0.051285419</returnvalue>
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>setseed</primary>
</indexterm>
<function>setseed</function> ( <type>double precision</type> )
<returnvalue>void</returnvalue>
</para>
<para>
Sets the seed for subsequent <literal>random()</literal> and
<literal>random_normal()</literal> calls;
argument must be between -1.0 and 1.0, inclusive
</para>
<para>
<literal>setseed(0.12345)</literal>
</para></entry>
</row>
</tbody>
</tgroup>
</table>
<para>
The <function>random()</function> and <function>random_normal()</function>
functions listed in <xref linkend="functions-math-random-table"/> use a
deterministic pseudo-random number generator.
It is fast but not suitable for cryptographic
applications; see the <xref linkend="pgcrypto"/> module for a more
secure alternative.
If <function>setseed()</function> is called, the series of results of
subsequent calls to these functions in the current session
can be repeated by re-issuing <function>setseed()</function> with the same
argument.
Without any prior <function>setseed()</function> call in the same
session, the first call to any of these functions obtains a seed
from a platform-dependent source of random bits.
</para>
<para>
<xref linkend="functions-math-trig-table"/> shows the
available trigonometric functions. Each of these functions comes in
two variants, one that measures angles in radians and one that
measures angles in degrees.
</para>
<table id="functions-math-trig-table">
<title>Trigonometric Functions</title>
<tgroup cols="1">
<thead>
<row>
<entry role="func_table_entry"><para role="func_signature">
Function
</para>
<para>
Description
</para>
<para>
Example(s)
</para></entry>
</row>
</thead>
<tbody>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>acos</primary>
</indexterm>
<function>acos</function> ( <type>double precision</type> )
<returnvalue>double precision</returnvalue>
</para>
<para>
Inverse cosine, result in radians
</para>
<para>
<literal>acos(1)</literal>
<returnvalue>0</returnvalue>
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>acosd</primary>
</indexterm>
<function>acosd</function> ( <type>double precision</type> )
<returnvalue>double precision</returnvalue>
</para>
<para>
Inverse cosine, result in degrees