This patch adds some missing functions for float8 math operations,

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
This commit is contained in:
Bruce Momjian
2002-10-19 02:08:19 +00:00
parent 5c6a5fe18b
commit bab3d29fba
7 changed files with 119 additions and 19 deletions

View File

@ -60,9 +60,18 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
SELECT '' AS five, f.f1, f.f1 % AS round_f1
FROM FLOAT8_TBL f;
SELECT sqrt(float8 '64') AS eight;
-- ceil
select ceil(f1) as ceil_f1 from float8_tbl f;
-- floor
select floor(f1) as floor_f1 from float8_tbl f;
-- sign
select sign(f1) as sign_f1 from float8_tbl f;
-- square root
SELECT sqrt(float8 '64') AS eight;
SELECT |/ float8 '64' AS eight;
SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1