From: Tom Lane Date: Thu, 23 Jan 2003 01:23:14 +0000 (+0000) Subject: Update 'Mathematical Functions' table to reflect 7.3 addition of float8 X-Git-Tag: REL7_3_2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d73531209cdb7d066b9e5b0fd7a380605e20ffbf;p=postgresql Update 'Mathematical Functions' table to reflect 7.3 addition of float8 forms of ceil(), floor(), sign(). Back-patch this and other recent doc fixes in this file to the 7.3 branch. --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 6b1f46984f..667a690d46 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -473,7 +473,8 @@ PostgreSQL documentation shown in . Bit string arguments to &, |, and # must be of equal length. When bit - shifting, the original length of the string is preserved, as shown in the table. + shifting, the original length of the string is preserved, as shown + in the table. @@ -519,17 +520,13 @@ PostgreSQL documentation shows the available mathematical functions. In the table, dp - indicates double precision. The functions - exp, ln, - log, pow, - round (1 argument), sqrt, - and trunc (1 argument) are also available for - the type numeric in place of double - precision. Functions returning a numeric - result take numeric input arguments, unless otherwise - specified. Many of these functions are implemented on top of the - host system's C library; accuracy and behavior in boundary cases - could therefore vary depending on the host system. + indicates double precision. Many of these functions + are provided in multiple forms with different argument types. + Except where noted, any given form of a function returns the same + datatype as its argument. + The functions working with double precision data are mostly + implemented on top of the host system's C library; accuracy and behavior in + boundary cases may therefore vary depending on the host system.
@@ -563,8 +560,8 @@ PostgreSQL documentation - ceil(numeric) - numeric + ceil(dp or numeric) + (same as input) smallest integer not less than argument ceil(-42.8) -42 @@ -579,32 +576,32 @@ PostgreSQL documentation - exp(dp) - dp + exp(dp or numeric) + (same as input) exponential exp(1.0) 2.71828182845905 - floor(numeric) - numeric + floor(dp or numeric) + (same as input) largest integer not greater than argument floor(-42.8) -43 - ln(dp) - dp + ln(dp or numeric) + (same as input) natural logarithm ln(2.0) 0.693147180559945 - log(dp) - dp + log(dp or numeric) + (same as input) base 10 logarithm log(100.0) 2 @@ -637,14 +634,23 @@ PostgreSQL documentation - pow(e dp, - n dp) + pow(x dp, + e dp) dp raise a number to exponent e pow(9.0, 3.0) 729 + + pow(x numeric, + e numeric) + numeric + raise a number to exponent e + pow(9.0, 3.0) + 729 + + radians(dp) dp @@ -656,14 +662,14 @@ PostgreSQL documentation random() dp - value between 0.0 to 1.0 + random value between 0.0 and 1.0 random() - round(dp) - dp + round(dp or numeric) + (same as input) round to nearest integer round(42.4) 42 @@ -685,32 +691,31 @@ PostgreSQL documentation --> - sign(numeric) - numeric + sign(dp or numeric) + (same as input) sign of the argument (-1, 0, +1) sign(-8.4) -1 - sqrt(dp) - dp + sqrt(dp or numeric) + (same as input) square root sqrt(2.0) 1.4142135623731 - trunc(dp) - dp + trunc(dp or numeric) + (same as input) truncate toward zero trunc(42.8) 42 - trunc(numeric, - r integer) + trunc(v numeric, s integer) numeric truncate to s decimal places trunc(42.4382, 2) @@ -724,7 +729,7 @@ PostgreSQL documentation Finally, shows the available trigonometric functions. All trigonometric functions - have arguments and return values of type double + take arguments and return values of type double precision. @@ -2032,7 +2037,7 @@ PostgreSQL documentation This section describes functions and operators for examining and - manipulating binary string values. Strings in this context include + manipulating binary string values. Strings in this context mean values of the type BYTEA. @@ -2120,6 +2125,60 @@ PostgreSQL documentation trim('\\000'::bytea from '\\000Tom\\000'::bytea) Tom + + + get_byte(string, offset) + integer + + Extract byte from string. + + get_byte + + + get_byte('Th\\000omas'::bytea, 4) + 109 + + + + set_byte(string, + offset, newvalue) + bytea + + Set byte in string. + + set_byte + + + set_byte('Th\\000omas'::bytea, 4, 64) + Th\000o@as + + + + get_bit(string, offset) + integer + + Extract bit from string. + + get_bit + + + get_bit('Th\\000omas'::bytea, 45) + 1 + + + + set_bit(string, + offset, newvalue) + bytea + + Set bit in string. + + set_bit + + + set_bit('Th\\000omas'::bytea, 45, 0) + Th\000omAs +
@@ -5400,7 +5459,7 @@ SELECT NULLIF(value, '(none)') ... - version + version() text PostgreSQL version information @@ -5469,8 +5528,8 @@ SELECT NULLIF(value, '(none)') ... - version() returns a string describing the PostgreSQL - server's version. + version() returns a string describing the + PostgreSQL server's version.