Is there a floating-point division function/operator?

Поиск
Список
Период
Сортировка
Искать

Is there a floating-point division function/operator?

От:
Jean-Christian Imbeault <jc@mega-bucks.co.jp>
Дата:
In Postgresql the "/" operator does integer division. Is there an 
operator or function that will do floating-point division?

I looked through the iDocs but there was no mention of such a function.

Thanks,

Jc

Re: Is there a floating-point division function/operator?

От:
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Дата:

On Thu, 23 Jan 2003, Jean-Christian Imbeault wrote:

> In Postgresql the "/" operator does integer division. Is there an
> operator or function that will do floating-point division?

/ does division based on the types of its operands

1/2 -> 0
1::float / 2 -> 0.5

FAQ