Float conversion bug?
Posted in 2000
Topics: Stored Procedures & SPL, Data Types & Schema Design, Third-Party Tools & Monitoring, Versions, Editions & End-of-Life
I found an interesting "feature" in IDS 7.31 UC6!
execute procedure float_conversion( 8.2 ) ;
returns:
8.2 8.20000000000000 8.1999999999999990 8.20000000000000
If seems to be a bug. Isn't it?
--------------------------------------------------------------------------
-- FLOAT_CONVERSION :
--------------------------------------------------------------------------
drop procedure float_conversion;
create procedure float_conversion( be varchar(255) ) returning varchar(255), float, varchar( 255 ), float;
define f1,f2 float;
define vc varchar(255);
let f1 = be; -- to float
let vc = f1; -- to varchar
let f2 = vc; -- and the varchar back to float
return be, f1, vc, f2;
end procedure;
I have the same returns in IDS 7.31 TC7 for NT 4.0.
"Wolf Péter" <peter.wolf@capsys.hu> schrieb im Newsbeitrag
news:90g5co$91o$1@news.xmission.com...
>
> I found an interesting "feature" in IDS 7.31 UC6!
>
> execute procedure float_conversion( 8.2 ) ;>
> returns:
>
> 8.2 8.20000000000000 8.1999999999999990 8.20000000000000
>
> If seems to be a bug. Isn't it?
>
>
> --------------------------------------------------------------------------
> -- FLOAT_CONVERSION :
> --------------------------------------------------------------------------
> drop procedure float_conversion;
> create procedure float_conversion( be varchar(255) ) returning varchar(> 255), float, varchar( 255 ), float;
>
> define f1,f2 float;
> define vc varchar(255);
>
> let f1 = be; -- to float
> let vc = f1; -- to varchar
> let f2 = vc; -- and the varchar back to float
>
> return be, f1, vc, f2;
>
> end procedure;
>
>
>