round(x) function

From: "Gaietti, Mauro \(SELEX GALILEO Guest, Italy\)" <mauro(dot)gaietti(at)guests(dot)selexgalileo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: round(x) function
Date: 2010-03-26 16:43:33
Message-ID: 9760841FB339C546BB304014810EB20D020ECBEB@GRPGEPWMX0011.grptop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This query:

select round(0.5), round(0.5::integer), round(0.5::bigint), round(
0.5::float ), round( 0.5::double precision ),round(cast(0.5 as double
precision )),round(cast(0.5::double precision as numeric )); has strange
result:

1 1 1 0 0 0 1

Is this correct?

My expected result is

1 1 1 1 1 1 1

Mauro


********************************************************************
SELEX Galileo S.p.A.
Con unico socio, direzione e coordinamento di Finmeccanica S.p.A.
Sede legale: Via Albert Einstein, 35 – 50013 Campi Bisenzio (FI) - Italia
Capitale sociale: Euro 293.391.015,00, i.v.
Reg. Imp. Firenze, C.F. e P.I. 02328910480
********************************************************************
This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person.

Questa e-mail e tutti i suoi allegati sono da intendersi inviati in via riservata all'effettivo destinatario e possono essere soggetti a restrizioni legali. Se non siete l'effettivo destinatario o avete ricevuto il messaggio per errore siete pregati di cancellarlo dal vostro sistema e di avvisare il mittente. E' vietata la duplicazione, l'uso a qualsiasi titolo, la divulgazione o la distribuzione dei contenuti di questa e-mail a qualunque altro soggetto.


Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2010-03-26 16:48:14 Re: Solid State Drives with PG (was: in RAM DB)
Previous Message Rajan, Pavithra 2010-03-26 16:34:34 Re: Need help on updating an entire column with a list of values, I have.