Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Round Issue with BINARY_DOUBLE and BINARY_FLOAT

996283Oct 31 2017 — edited Nov 1 2017

Hello Everyone,

Below are some queries which behaves differently in case of BINARY_DOUBLE and BINARY_FLOAT data type.

           SELECT ROUND(CAST(28369.524079320112 AS binary_double) ,3) FROM DUAL; --28369.524

           SELECT ROUND(CAST(16.7415 AS binary_double) ,3) FROM DUAL; --16.741

          

           SELECT ROUND(CAST(28369.524079320112 AS binary_float) ,3) FROM DUAL; --28369.523

           SELECT ROUND(CAST(16.7415 AS binary_float) ,3) FROM DUAL; --16.742

can some please explain to me why this type of behaviour is with these data types.

Thanks,

Vipin Kumar Rai

This post has been answered by mathguy on Oct 31 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2017
Added on Oct 31 2017
10 comments
1,507 views