Re: [GENERAL] round(real,integer)

2014-01-10 Thread Paul Ramsey
True (?) though I’m guessing the real test for most folks is if printf renders it as expected. Anything else if icing on the cake, no? P --  Paul Ramsey http://cleverelephant.ca http://postgis.net On January 10, 2014 at 1:09:24 PM, Tom Lane (t...@sss.pgh.pa.us) wrote: to, say, 6 digits produce

Re: [GENERAL] round(real,integer)

2014-01-10 Thread Tom Lane
Paul Ramsey writes: > What surprises do you think would come from a > round(real, integer) returns real > function?  People might expect that rounding to, say, 6 digits produces an exact decimal answer. Even if you're not exceeding 6 digits overall, it's unlikely that the answer is *exact*, if

Re: [GENERAL] round(real,integer)

2014-01-10 Thread Paul Ramsey
What surprises do you think would come from a round(real, integer) returns real function?  Just asking the question, I guess I can see the answer, since though round() is usually used to reduce precision, it’s also possible to use it to increase it arbitrarily… bah. It does bug me a fair bit,

Re: [GENERAL] round(real,integer)

2014-01-10 Thread Tom Lane
Paul Ramsey writes: > History question: > Why does select round(3,3) work,  >          select round(3.0,3) work,  > but      select round(3.0::real,1) not work? The 2-argument round() function actually takes (numeric, integer). There's an implicit cast from int to numeric, but not an i