Is there a floating-point division function/operator?

Started by Jean-Christian Imbeaultabout 23 years ago2 messagesgeneral
Jump to latest
#1Jean-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

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Jean-Christian Imbeault (#1)
Re: Is there a floating-point division function/operator?

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