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

Why are calculations carried out in floating-point arithmetric? #209

Open
yaccos opened this issue Aug 18, 2021 · 0 comments
Open

Why are calculations carried out in floating-point arithmetric? #209

yaccos opened this issue Aug 18, 2021 · 0 comments

Comments

@yaccos
Copy link
Contributor

yaccos commented Aug 18, 2021

I have noticed some strange computations in rowDiffs.c. In this line:

 ncol_ans = (R_xlen_t)((double)ncols - ((double)diff*(double)lagg));

all of the operands (which are of type R_xlen_t) are converted to double before the compuation and then the answer is converted back to R_xlen_t. I do not see any obvious reason why this could be computed in integer arithmetric and there is no comment explaining why this is done with floating-point numbers.

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

No branches or pull requests

1 participant