Skip to Main Content

Data Science & Machine Learning

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!

Different representation of numbers in R and ROracle

3410210Mar 7 2017 — edited Mar 14 2017

I have recently started to use the package ROracle to exchange data between R and Oracle, but I have a precision problem when retrieving numbers with decimal digits. Here's an example:

#With library ROracle: 
out<-dbGetQuery(conRORA, "select 1.39 from dual")
dbDisconnect
(conRORA)
[1] TRUE
#but:
out[1,]==1.39
[1] FALSE
out[1,]-1.39
[1] 2.22044604925e-16

The number extracted with ROracle differs from the same number written directly in the console. Anyone else had the same problem? is there some configuration to resolve this? I know it seems insignificant but it could give unexpected results when comparing numbers in Oracle with numbers in R.

Thanks

This post has been answered by rtiran on Mar 10 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2017
Added on Mar 7 2017
2 comments
427 views