Skip site navigation (1) Skip section navigation (2)

Re: como dividir?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Henry <hensa22(at)yahoo(dot)es>
Cc: Rodriguez Fernando <rodriguez(at)ort(dot)edu(dot)uy>, ricardo yanguma <ricardo(dot)yanguma(at)gmail(dot)com>, postgresayuda <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: como dividir?
Date: 2008-01-31 11:49:23
Message-ID: 20080131114922.GA5145@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
Algo que no se ha comentado es la precisiĆ³n del resultado.  Considera

alvherre=# select 1::float/7;
     ?column?      
-------------------
 0.142857142857143
(1 row)

alvherre=# select 1::float8/7;
     ?column?      
-------------------
 0.142857142857143
(1 row)

alvherre=# select 1::numeric/7;
        ?column?        
------------------------
 0.14285714285714285714
(1 row)

alvherre=# select 1::numeric(44,42)/7;
                   ?column?                   
----------------------------------------------
 0.142857142857142857142857142857142857142857
(1 row)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

pgsql-es-ayuda by date

Next:From: Toni CasuepsDate: 2008-01-31 11:51:11
Subject: duda de expresiones regulares
Previous:From: HenryDate: 2008-01-31 11:41:36
Subject: Re: como dividir?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group