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: Odd math

Re: Odd math

From: Dag Arne Matre <dam_at_visma.no>
Date: 2000/07/12
Message-ID: <1RTa5.5$qP.12288@juliett.dax.net>#1/1

"Steve Adams" <steve.adams_at_ixora.com.au> wrote in message news:396befcf.127433039_at_news.eagles.bbs.net.au...
> Hi All,
>
> Oracle 8.1.6 appears to think that ... trunc(log(2, 4)) = 1.
>
> SQL> select trunc(log(2,4)) from dual;
>
> TRUNC(LOG(2,4))
> ---------------
> 1
>
> Does it reproduce on earlier versions?
> Any comments?

select log(2, 4) from dual;

=> 2.000000000000000000

However:
select to_char(log(2, 4)) from dual;

=> 1.99999999999999999999999999999999999998
which should be 1 truncated....

and

select trunc(log(2, 4) + 0.000000000000000001) from dual;
=> 2

I'm on 8.0.5.1.

D A Received on Wed Jul 12 2000 - 00:00:00 CDT

Original text of this message

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