To force the appropriate overload, using one of these two conversion functions:
v_float_nr:= to_binary_float(numeric variable) v_double_nr:= to_binary_double(numeric variable)
SQL> SQL> declare-- w ww .j a v a 2 s . c o m 2 v_nr binary_float; 3 begin 4 for i in 1..1000000 loop 5 v_nr:=sqrt(to_binary_float(i)); 6 end loop; 7 end; 8 / PL/SQL procedure successfully completed. Elapsed: 00:00:00.17 SQL>
The conversion from NUMBER to BINARY_FLOAT/DOUBLE is not exact.
Because NUMBER data is rounded to a decimal point and BINARY data is rounded to a binary value.