"Rafael Villalobos Prats" <rvillalobos@asapci.es> writes:
> Why is different: 'SELECT (xxxxx)::FLOAT8' than 'SELECT xxxxx::FLOAT8'
The :: operator binds more tightly than most other operators. As Iain
replied, most of your divisions are going to be integer divisions that
discard the fractional part. You can either add casts or add ".0" to
your numbers to cause them to be considered non-integers.
regards, tom lane