Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Odd math
"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.99999999999999999999999999999999999998which 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
![]() |
![]() |