summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/float.c
AgeCommit message (Collapse)Author
2002-10-19This patch adds some missing functions for float8 math operations,Bruce Momjian
specifically ceil(), floor(), and sign(). There may be other functions that need to be added, but this is a start. I've included some simple regression tests. Neil Conway
2002-09-04pgindent run.Bruce Momjian
2002-08-26Modify array operations to include array's element type OID in theTom Lane
array header, and to compute sizing and alignment of array elements the same way normal tuple access operations do --- viz, using the tupmacs.h macros att_addlength and att_align. This makes the world safe for arrays of cstrings or intervals, and should make it much easier to write array-type-polymorphic functions; as examples see the cleanups of array_out and contrib/array_iterator. By Joe Conway and Tom Lane.
2002-06-20Update copyright to 2002.Bruce Momjian
2001-12-11Repair roundoff-error problem for stddev/variance results near zero,Tom Lane
per complaint from Kemin Zhou. Fix lack of precision in numeric stddev/variance.
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-10-28Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian
spacing. Also adds space for one-line comments.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-06-07This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian
Marko Kreen
2001-06-02Accept and output '-Infinity' as well as 'Infinity', per long-agoTom Lane
suggestion from Ross Reedstrom. Still needs work to make those symbols convert to actual IEEE infinities (on machines where such things exist).
2001-06-02Paranoia about unordered comparisons in IEEE float math. If we areTom Lane
given values that compare as unordered, make sure we reply that they are equal, which is better than giving an arbitrary answer --- at least it doesn't depend on which one is passed as which arg.
2001-05-03Ensure that btree sort ordering functions and boolean comparison operatorsTom Lane
give consistent results for all datatypes. Types float4, float8, and numeric were broken for NaN values; abstime, timestamp, and interval were broken for INVALID values; timetz was just plain broken (some possible pairs of values were neither < nor = nor >). Also clean up text, bpchar, varchar, and bit/varbit to eliminate duplicate code and thereby reduce the probability of similar inconsistencies arising in the future.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2000-08-07Clean up bogosities in use of random(3) and srandom(3) --- do not assumeTom Lane
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.
2000-08-01Convert all remaining float4 and float8 functions to new fmgr style.Tom Lane
At this point I think it'd be possible to make float4 be pass-by-value without too much work --- and float8 too on machines where Datum is 8 bytes. Something to try when the mood strikes, anyway.
2000-07-28Remove <values.h> inclusions, no-longer-needed MAXINT definitions.Tom Lane
2000-07-17Revise aggregate functions per earlier discussions in pghackers.Tom Lane
There's now only one transition value and transition function. NULL handling in aggregates is a lot cleaner. Also, use Numeric accumulators instead of integer accumulators for sum/avg on integer datatypes --- this avoids overflow at the cost of being a little slower. Implement VARIANCE() and STDDEV() aggregates in the standard backend. Also, enable new LIKE selectivity estimators by default. Unrelated change, but as long as I had to force initdb anyway...
2000-07-12Remove a bunch of unused configure tests, in particular cases wherePeter Eisentraut
* the result is not recorded anywhere * the result is not used anywhere * the result is only used in some places, whereas others have been getting away with it * the result is used improperly Also make command line options handling a little better (e.g., --disable-locale, while redundant, should really still *dis*able).
2000-07-06Functions on 'text' type updated to new fmgr style. 'text' isTom Lane
now TOAST-able.
2000-07-03TOASTJan Wieck
WARNING: This is actually broken - we have self-deadlocks due to concurrent changes in buffer management. Vadim and me are working on it. Jan
2000-06-14Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut
we'll get there one day. Use `cat' to create aclocal.m4, not `aclocal'. Some people don't have automake installed. Only run the autoconf rule in the top-level GNUmakefile if the invoker specified `make configure', don't run it automatically because of CVS timestamp skew.
2000-06-13Another batch of fmgr updates. I think I have gotten all old-styleTom Lane
functions that take pass-by-value datatypes. Should be ready for port testing ...
2000-06-08Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian
2000-06-05Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane
inputs have been converted to newstyle. This should go a long way towards fixing our portability problems with platforms where char and short parameters are passed differently from int-width parameters. Still more to do for the Alpha port however.
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-04-07Add transcendental math functions (sine, cosine, etc)Thomas G. Lockhart
Add a random number generator and seed setter (random(), SET SEED) Fix up the interval*float8 math to carry partial months into the time field. Add float8*interval so we have symmetry in the available math. Fix the parser and define.c to accept SQL92 types as field arguments. Fix the parser to accept SQL92 types for CREATE TYPE, etc. This is necessary to allow... Bit/varbit support in contrib/bit cleaned up to compile and load cleanly. Still needs some work before final release. Implement the "SOME" keyword as a synonym for "ANY" per SQL92. Implement ascii(text), ichar(int4), repeat(text,int4) to help support the ODBC driver. Enable the TRUNCATE() function mapping in the ODBC driver.
2000-03-23Float-to-int conversion functions should return NULL when given NULLTom Lane
input, not throw a gratuitous elog().
2000-03-14Implement column aliases on views "CREATE VIEW name (collist)".Thomas G. Lockhart
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.
2000-01-26Add:Bruce Momjian
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
2000-01-15Fixed all elog related warnings, as well as a few others.Peter Eisentraut
1999-12-20Finally found a platform which has finite() but nonetheless sets errnoTom Lane
rather than returning a NaN for bogus input to pow(). Namely, HPUX 10.20. I think this is sufficient evidence for what I thought all along, which is that the float.c code *must* look at errno whether finite() exists or not.
1999-10-02Replace float.c's #ifdef finite check with a proper autoconf check, so itTom Lane
works if finite() is a function. Patch from Christof Petig.
1999-09-26Modify nodeAgg.c so that no rows are returned for a GROUP BYTom Lane
with no input rows, per pghackers discussions around 7/22/99. Clean up a bunch of ugly coding while at it; remove redundant re-lookup of aggregate info at start of each new GROUP. Arrange to pfree intermediate values when they are pass-by-ref types, so that aggregates on pass-by-ref types no longer eat memory. This takes care of a couple of TODO items...
1999-09-21values.h patch from Alex HowanskyBruce Momjian
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-16Update #include cleanupsBruce Momjian
1999-07-15Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian
1999-07-14Cleanup of /include #include's, for 6.6 only.Bruce Momjian
1999-07-13More cpu cleanups, only for 6.6.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-04-20Portability patches for HPUX 11 and Unixware in configureTom Lane
and related files. Also remove float.c's gratuitous redeclaration of isinf() ... looks like there are more decls in there that ought to be in config.h, but I'll leave well enough alone for now ...
1999-02-13Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian
1999-01-24Improper addition of NaN/Infinity recognition to float8in()Tom Lane
was causing it not to detect out-of-range float values, as evidenced by failure of float8 regression test. I corrected that logic and also modified expected float8 results to account for new error message generated for out-of-range inputs.
1999-01-21FOR UPDATE is in parser & rules.Vadim B. Mikheev
1999-01-17Fix for missing NAN.Bruce Momjian
1999-01-10Handle "NaN" and "Infinity" for input values.Thomas G. Lockhart
I think NAN is already guaranteed to be there from Jan's work on NUMERIC, but perhaps HUGE_VAL needs some #ifndef's in the same place. Should also include "-Infinity" as -HUGE_VAL sometime; not there yet.
1998-11-29Change exp() behavior to generate error on underflow ratherTom Lane
than silently returning zero on some machines. Correct float8 regress test to agree. Also fix pow() overflow/underflow check to work correctly on HPUX.
1998-11-17Add text<->float8 and text<->float4 conversion functions.Thomas G. Lockhart
This will fix the problem reported by Jose' Soares when trying to cast a float to text.
1998-09-01OK, folks, here is the pgindent output.Bruce Momjian