Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in arithmetic operation with NA as argument #1

Open
TDiazT opened this issue Jun 12, 2018 · 2 comments
Open

Bug in arithmetic operation with NA as argument #1

TDiazT opened this issue Jun 12, 2018 · 2 comments
Labels

Comments

@TDiazT
Copy link
Collaborator

TDiazT commented Jun 12, 2018

  • R program that triggers the difference
1 + NA

(Any sum using NA)
  • runR.native Output
[1] NaN
  • R Output
[1] NA 
  • Additional information

I am wondering if it has something to do with using Double.add.
I noticed in bisect that this execution goes all the way from do_arith to R_binary. The checks at the source code (first, snd) return false (which seems ok). Then it jumps straight to calling R_binary.

In R_binary it skips the checks for array (makes sense) and in this check it enters. It ends up calling real_binary (source) and ends ups performing this operation (coqR code)

@TDiazT TDiazT added the bug label Jun 12, 2018
@TDiazT TDiazT changed the title Bug in '+' operation with NA as argument Bug in arithmetic operation with NA as argument Jun 12, 2018
@TDiazT
Copy link
Collaborator Author

TDiazT commented Jun 12, 2018

Actually it happens with every arithmetic operation.

1 + NA
1 * NA
NA/NaN
1 - NA

NaN/NA produces the correct result though.

@Mbodin
Copy link
Owner

Mbodin commented Jun 12, 2018

If I remember correctly, there was an issue with NA_real, which displays NaN or something like that.

We are messing with OCaml's nan to differenciate NA from NaN and I guess that OCaml doesn't like that (because of some optimisations?). I don’t think that this is too big an issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants