Search Postgresql Archives

Re: integer instead of 'double precision'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 9, 2011 at 5:09 PM, Guillaume Lelarge <guillaume@xxxxxxxxxxxx> wrote:
You divide an integer with an integer, that should give you an integer.

Can you tell me the reasoning behind that idea?
Is it a rule that the output type of an operator must equal the input type?
In this case that doesn't seem locigal. I think that the "/" operator should return something that allows fractions, since the operator creates fractions so frequently.
If you should need it to be an integer, e.g. when you update an integer column, casting should  be done just-in-time.

But i don't know much about the internals and the reasoning behind these matters, i would be grateful if you could explain.

Cheers,

WBL

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux