aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/float.c
Commit message (Collapse)AuthorAge
...
* Make SQL arrays support null elements. This commit fixes the core arrayTom Lane2005-11-17
| | | | | | | | functionality, but I still need to make another pass looking at places that incidentally use arrays (such as ACL manipulation) to make sure they are null-safe. Contrib needs work too. I have not changed the behaviors that are still under discussion about array comparison and what to do with lower bounds.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Apply the "nodeAgg" optimization to more of the builtin transitionNeil Conway2005-04-06
| | | | | | | | | | functions. This patch optimizes int2_sum(), int4_sum(), float4_accum() and float8_accum() to avoid needing to copy the transition function's state for each input tuple of the aggregate. In an extreme case (e.g. SELECT sum(int2_col) FROM table where table has a single column), it improves performance by about 20%. For more complex queries or tables with wider rows, the relative performance improvement will not be as significant.
* Adjust input routines for float4, float8 and oid to reject the empty stringNeil Conway2005-02-11
| | | | | as valid input (it was previously treated as 0). This input was deprecated in 8.0 (and a warning was emitted). Regression tests updated.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Detect overflow in integer arithmetic operators (integer, smallint, andTom Lane2004-10-04
| | | | | | | | bigint variants). Clean up some inconsistencies in error message wording. Fix scanint8 to allow trailing whitespace in INT64_MIN case. Update int8-exp-three-digits.out, which seems to have been ignored by the last couple of people to modify the int8 regression test, and remove int8-exp-three-digits-win32.out which is thereby exposed as redundant.
* Cope with recent HPUX versions providing isfinite() instead of finite().Tom Lane2004-09-02
|
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Work around broken strtod() that's present in many Solaris releases.Tom Lane2004-08-11
| | | | Thanks to Michael Fuhr for identifying the problem.
* Label CVS tip as 8.0devel instead of 7.5devel. Adjust various commentsTom Lane2004-08-04
| | | | and documentation to reference 8.0 instead of 7.5.
* Change ln(), log(), power(), and sqrt() to emit the correct SQLSTATENeil Conway2004-05-16
| | | | error codes for certain error conditions, as specified by SQL2003.
* Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane2004-05-07
| | | | | | | | | | | | | conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
* Fix some portability issues with new float input code (didn't work onTom Lane2004-04-01
| | | | HPUX 11 ...)
* Add missing casts to unsigned char in recently-added isspace() calls.Tom Lane2004-04-01
|
* Localize our dependencies on the way to create NAN or INFINITY.Tom Lane2004-03-15
| | | | Per recent proposal to pghackers.
* Portability fixes and bug fixes for recent floating point input changes.Neil Conway2004-03-14
| | | | | | | | In particular, don't depend on strtod() to accept 'NaN' and 'Infinity' inputs (while this is required by C99, not all platforms are compliant with that yet). Also, don't require glibc's behavior from isinf(): it seems that on a lot of platforms isinf() does not itself distinguish between negative and positive infinity.
* Allow 'Infinity' and '-Infinity' as input to the float4 and float8Neil Conway2004-03-12
| | | | | | | | | types. Update the regression tests and the documentation to reflect this. Remove the UNSAFE_FLOATS #ifdef. This is only half the story: we still unconditionally reject floating point operations that result in +/- infinity. See recent thread on -hackers for more information.
* Revise int2/int4/int8/float4/float8 input routines to allow forNeil Conway2004-03-11
| | | | | | | | | | any amount of leading or trailing whitespace (where "whitespace" is defined by isspace()). This is for SQL conformance, as well as consistency with other numeric types (e.g. oid, numeric). Also refactor pg_atoi() to avoid looking at errno where not necessary, and add a bunch of regression tests for the input to these types.
* Emit a warning when an empty string is input to the oid, float4, andNeil Conway2004-03-04
| | | | | | | | float8 types. This begins the deprecation of this feature: in 7.6, this input will be rejected. Also added a new error code for warnings about deprecated features, and updated the regression tests.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Cross-data-type comparisons are now indexable by btrees, pursuant to myTom Lane2003-11-12
| | | | | | | | | | pghackers proposal of 8-Nov. All the existing cross-type comparison operators (int2/int4/int8 and float4/float8) have appropriate support. The original proposal of storing the right-hand-side datatype as part of the primary key for pg_amop and pg_amproc got modified a bit in the event; it is easier to store zero as the 'default' case and only store a nonzero when the operator is actually cross-type. Along the way, remove the long-since-defunct bigbox_ops operator class.
* Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut2003-09-25
| | | | | terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* Fix numeric_smaller, numeric_larger, float4smaller, float4larger,Tom Lane2003-07-30
| | | | | | | | float8smaller, float8larger (and thereby the MIN/MAX aggregates on these datatypes) to agree with the datatypes' comparison operations as regards NaN handling. In all these datatypes, NaN is arbitrarily considered larger than any normal value ... but MIN/MAX had not gotten the word. Per recent discussion on pgsql-sql.
* Error message editing in utils/adt. Again thanks to Joe Conway for doingTom Lane2003-07-27
| | | | the bulk of the heavy lifting ...
* Remove comment that cbrt() isn't being used.Bruce Momjian2003-05-26
|
* Clean up our static cbrt() implementation in float.c.Bruce Momjian2003-05-25
|
* COPY BINARY uses the new binary I/O routines. Update a few more datatypesTom Lane2003-05-09
| | | | so that COPY BINARY regression test passes.
* Remove another old rint() replacement.Bruce Momjian2003-05-09
|
* stddev() and variance() should return NULL when there is just one inputTom Lane2003-04-21
| | | | value, per recent discussion on pgsql-general.
* Add explicit tests for division by zero to all user-accessible integerTom Lane2003-03-11
| | | | | | | | division and modulo functions, to avoid problems on OS X (which fails to trap 0 divide at all) and Windows (which traps it in some bizarre nonstandard fashion). Standardize on 'division by zero' as the one true spelling of this error message. Add regression tests as suggested by Neil Conway.
* Add extra_float_digits GUC parameter to allow adjustment of displayedTom Lane2002-11-08
| | | | | | | precision for float4, float8, and geometric types. Set it in pg_dump so that float data can be dumped/reloaded exactly (at least on platforms where the float I/O support is properly implemented). Initial patch by Pedro Ferreira, some additional work by Tom Lane.
* This patch adds some missing functions for float8 math operations,Bruce Momjian2002-10-19
| | | | | | | | 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
* pgindent run.Bruce Momjian2002-09-04
|
* Modify array operations to include array's element type OID in theTom Lane2002-08-26
| | | | | | | | | | 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.
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* Repair roundoff-error problem for stddev/variance results near zero,Tom Lane2001-12-11
| | | | | per complaint from Kemin Zhou. Fix lack of precision in numeric stddev/variance.
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-28
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian2001-06-07
| | | | Marko Kreen
* Accept and output '-Infinity' as well as 'Infinity', per long-agoTom Lane2001-06-02
| | | | | suggestion from Ross Reedstrom. Still needs work to make those symbols convert to actual IEEE infinities (on machines where such things exist).
* Paranoia about unordered comparisons in IEEE float math. If we areTom Lane2001-06-02
| | | | | | 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.
* Ensure that btree sort ordering functions and boolean comparison operatorsTom Lane2001-05-03
| | | | | | | | | | 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.
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Clean up bogosities in use of random(3) and srandom(3) --- do not assumeTom Lane2000-08-07
| | | | | | | 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.
* Convert all remaining float4 and float8 functions to new fmgr style.Tom Lane2000-08-01
| | | | | | 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.