| От | Tom Lane |
|---|---|
| Тема | Re: integer instead of 'double precision'? |
| Дата | |
| Msg-id | 11955.1315581161@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | integer instead of 'double precision'? (Henry Drexler <alonup8tb@gmail.com>) |
| Ответы |
Re: integer instead of 'double precision'?
|
| Список | pgsql-general |
Henry Drexler <alonup8tb@gmail.com> writes: > [ "1/3" yields zero ] Yeah, it's an integer division. > I thought perhaps I could cast it as double precision as noted on > http://www.postgresql.org/docs/8.3/interactive/sql-expressions.html > though doing the following: > float8(1/3) That's casting the result of the division to float, which is way too late. You need to cast one or both inputs to non-integer, for instance 1.0/3 1/(3::float8) etc etc. regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера