Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: FLOOR and CEIL bug ??

Re: FLOOR and CEIL bug ??

From: Andrew Protasov <oracle_at_protasov.kiev.ua>
Date: 1998/12/05
Message-ID: <ABc3KQsK42@protasov.kiev.ua>#1/1

Hi,

It is not a bug. I made some equivalent transformations of your query:

SVRMGR> select x,floor(x),ceil(x) from (select 90492145/(90492145/19) x from dual); X FLOOR(X) CEIL(X)
---------- ---------- ----------

        19 18 19
1 row selected.

SVRMGR> select to_char(x,'990.0000000000000000000000000000000000000000000000'),floor(x),ceil(x) from (select 90492145/(90492145/19) x from dual);
TO_CHAR(X,'990.000000000000000000000000000000000000 FLOOR(X)   CEIL(X)
--------------------------------------------------- ---------- ----------
  18.9999999999999999999999999999999999999800000000         18         19
1 row selected.

The result of division is slightly less than 19. This is typical lost of precision during division.

Andrew Protasov

> I have made this query:
> select (90523434-31289)/(90492145/19)
> Division,floor((90523434-31289)/(90492145/19))
> Floor,ceil((90523434-31289)/(90492145/19)) Ceil from dual;
> and the resul is :
> Division Floor Ceil
> ---------- ---------- ----------
> 19 18 19
>
> For me there is a Oracle bug. What do you thing ??
> --
> Gambelli Domenico
> E-Mail: domenico_at_webbridges.it
>
> Tel.:+39 06 47823776
> Fax :+39 06 48906270
> GSM :+39 0347 7513467
>
>
>
>
  Received on Sat Dec 05 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US