diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 2000-03-14 23:06:59 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 2000-03-14 23:06:59 +0000 |
commit | 64568100787a5d03d036e70b32147385a35245e2 (patch) | |
tree | 4b6091aedff9deed40992a05d1cacf9ce1b54c8b /src/backend/utils/adt/float.c | |
parent | ce543b2121a772d18e25e1efbad252dcd360df96 (diff) | |
download | postgresql-64568100787a5d03d036e70b32147385a35245e2.tar.gz postgresql-64568100787a5d03d036e70b32147385a35245e2.zip |
Implement column aliases on views "CREATE VIEW name (collist)".
Implement TIME WITH TIME ZONE type (timetz internal type).
Remap length() for character strings to CHAR_LENGTH() for SQL92
and to remove the ambiguity with geometric length() functions.
Keep length() for character strings for backward compatibility.
Shrink stored views by removing internal column name list from visible rte.
Implement min(), max() for time and timetz data types.
Implement conversion of TIME to INTERVAL.
Implement abs(), mod(), fac() for the int8 data type.
Rename some math functions to generic names:
round(), sqrt(), cbrt(), pow(), etc.
Rename NUMERIC power() function to pow().
Fix int2 factorial to calculate result in int4.
Enhance the Oracle compatibility function translate() to work with string
arguments (from Edwin Ramirez).
Modify pg_proc system table to remove OID holes.
Diffstat (limited to 'src/backend/utils/adt/float.c')
-rw-r--r-- | src/backend/utils/adt/float.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 0a0df27b808..6af9cd906d3 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.53 2000/01/26 05:57:14 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.54 2000/03/14 23:06:36 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -1236,6 +1236,31 @@ dlog1(float64 arg1) return result; } +/* + * dlog10 - returns a pointer to the base 10 logarithm of arg1 + */ +float64 +dlog10(float64 arg1) +{ + float64 result; + double tmp; + + if (!PointerIsValid(arg1)) + return (float64) NULL; + + result = (float64) palloc(sizeof(float64data)); + + tmp = *arg1; + if (tmp == 0.0) + elog(ERROR, "can't take log of zero"); + if (tmp < 0) + elog(ERROR, "can't take log of a negative number"); + *result = (float64data) log10(tmp); + + CheckFloat8Val(*result); + return result; +} /* dlog10() */ + /* * ==================== |