round(x) function - Mailing list pgsql-general

From Gaietti, Mauro \(SELEX GALILEO Guest, Italy\)
Subject round(x) function
Date
Msg-id 9760841FB339C546BB304014810EB20D020ECBEB@GRPGEPWMX0011.grptop.net
Whole thread Raw
Responses Re: round(x) function  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.

 

 

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Solid State Drives with PG (was: in RAM DB)
Next
From: Tom Lane
Date:
Subject: Re: round(x) function