aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/numeric.c
Commit message (Collapse)AuthorAge
...
* 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.
* Make selectivity routines cope gracefully with NaNs, infinities, andTom Lane2001-10-13
| | | | | NUMERIC values that are out of the range of 'double'. Per trouble report from Mike Quinn.
* Implement precision support for timestamp and time, both with and withoutThomas G. Lockhart2001-10-03
| | | | | | | | | | | | time zones. SQL99 spec requires a default of zero (round to seconds) which is set in gram.y as typmod is set in the parse tree. We *could* change to a default of either 6 (for internal compatibility with previous versions) or 2 (for external compatibility with previous versions). Evaluate entries in pg_proc wrt the iscachable attribute for timestamp and other date/time types. Try to recognize cases where side effects like the current time zone setting may have an effect on results to decide whether something is cachable or not.
* sum() on int2 and int4 columns now uses an int8, not numeric, accumulatorTom Lane2001-08-14
| | | | | | | | | | | | | | | | | | | | for speed reasons; its result type also changes to int8. avg() on these datatypes now accumulates the running sum in int8 for speed; but we still deliver the final result as numeric, so that fractional accuracy is preserved. count() now counts and returns in int8, not int4. I am a little nervous about this possibly breaking users' code, but there didn't seem to be a strong sentiment for avoiding the problem. If we get complaints during beta, we can change count back to int4 and add a "count8" aggregate. For that matter, users can do it for themselves with a simple CREATE AGGREGATE command; the int4inc function is still present, so no C hacking is needed. Also added max() and min() aggregates for OID that do proper unsigned comparison, instead of piggybacking on int4 aggregates. initdb forced.
* This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian2001-06-07
| | | | Marko Kreen
* 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.
* Another try at making numeric MODULO operator produce the right answer.Tom Lane2001-04-14
| | | | | | Although it was now using the right equation, it was making bogus choices of the precision to compute intermediate results to. I'm not sure this is really right even yet, but it's better than before ...
* Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian2001-03-22
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Fix numeric modulo operator for case of fractional right argument.Tom Lane2001-03-14
|
* Silence compiler warning.Tom Lane2000-12-07
|
* Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane2000-12-03
| | | | | values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
* 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.
* bpchar, varchar, bytea, numeric are toastable --- if you initdb, whichTom Lane2000-07-29
| | | | | | I did not force. I marked numeric as compressable-but-not-move-off-able, partly to test that storage mode and partly because I've got doubts that numerics are large enough to need external storage.
* Revise aggregate functions per earlier discussions in pghackers.Tom Lane2000-07-17
| | | | | | | | | | | 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...
* Clean up #include's.Bruce Momjian2000-06-15
|
* Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut2000-06-14
| | | | | | | | | | | 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.
* Another batch of fmgr updates. I think I have gotten all old-styleTom Lane2000-06-13
| | | | | functions that take pass-by-value datatypes. Should be ready for port testing ...
* Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane2000-06-05
| | | | | | | 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.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Extend numeric_round and numeric_trunc to accept negative scale inputsTom Lane2000-03-13
| | | | | | (ie, allow rounding to occur at a digit position left of the decimal point). Apparently this is how Oracle handles it, and there are precedents in other programming languages as well.
* Add numeric <-> int8 and numeric <-> int2 conversion functions, as wellTom Lane2000-02-24
| | | | | | | | | | as a unary minus operator for numeric. Now that long numeric constants will get converted to NUMERIC in early parsing, it's essential to have numeric->int8 conversion to avoid 'can't convert' errors on undecorated int8 constants. Threw in the rest for completeness while I was in the area. I did not force an initdb for this, since the system will still run without the new pg_proc/pg_operator entries. Possibly I should've.
* Fix bugs in NUMERIC ceil() and floor() functions. ceil(0) returned 1,Tom Lane2000-01-20
| | | | | and both would insert random junk digits if given an input that was an exact multiple of 10.
* numeric_in accepts exponents; numeric to int4 rounds; float4/8 to numericTom Lane2000-01-18
| | | | | | is considerably more robust and accurate than it used to be. Also, get rid of numeric's private allocation freelist, which is no longer a win since Jan rewrote palloc.
* Clean up problems with rounding/overflow code in NUMERIC, particularlyTom Lane2000-01-15
| | | | | the case wherein zero was rejected for a field like NUMERIC(4,4). Miscellaneous other code beautification efforts.
* Fix it's and its to be correct.Bruce Momjian2000-01-05
|
* Added nbtree operator class for NUMERICJan Wieck1999-09-29
| | | | Jan
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-15
|
* Cleanup of /include #include's, for 6.6 only.Bruce Momjian1999-07-14
|
* Another pgindent run. Sorry folks.Bruce Momjian1999-05-25
|
* Make 0x007f -> (unsigned)0x7f to make pgindent happy.Bruce Momjian1999-05-25
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* Check for NUMERIC overflow a second time after roundingJan Wieck1999-05-10
| | | | Jan
* Use sprintf() to convert float8 to a string during conversion to numeric.Thomas G. Lockhart1999-05-04
| | | | | Original code used float8out(), but the resulting exponential notation was not handled (e.g. '3E9' was decoded as '3').
* src/backend/utils/adt/numeric.c fails to compile due to a string havingBruce Momjian1999-03-14
| | | | | | | | an embedded new-line character. Billy G. Allie
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Removed precision restriction in numeric_round() causingJan Wieck1999-01-05
| | | | | | | overflow error on high precision calculations where temporary huge precision is required. Jan
* Just one more bugfix - this time in cmp_abs (cannot imagine thatJan Wieck1999-01-04
| | | | | | | taking a logarithm with a 400 digit precision worked with that bug in place). Jan
* Fixed backend crashing bug in apply_typmod()Jan Wieck1999-01-04
| | | | Jan
* Little fix for round() functionJan Wieck1999-01-04
| | | | Jan
* Fix NAN code.Bruce Momjian1999-01-03
|
* Fix for NAN generation.Bruce Momjian1999-01-03
|
* Fix for no platform NAN.Bruce Momjian1999-01-01
|
* Little precision fix for POWER(). I discovered problems with bigJan Wieck1998-12-30
| | | | | | exponents. Jan
* Added NUMERIC data type with many builtin funcitons, operatorsJan Wieck1998-12-30
and aggregates. Jan