Skip to content

Conversation

@Abhi-1U
Copy link

@Abhi-1U Abhi-1U commented Jul 12, 2024

Alternative Implementation to fix bug https://bugs.r-project.org/show_bug.cgi?id=15027, r-devel/r-dev-day#4

Test cases were originally written by @loreabad6.

int c_pr = c;
if (c > R_print.max) {
c_pr = R_print.max;
r_pr = 1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should remain set to 0 if r is 0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting the mistake.
so adding a check for r > 0 before setting r_pr to 1 should be a good fix.

## case: omitting cols, at least one row prints
print(matrix(nrow = 1, ncol = 6), max = 5)
## in R 4.4.0 there should be a warning for ommited rows (NEW BUG)
print(array(dim = c(2, 4, 1)), max = 3)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a typo in the issue, this is actually:

print(array(dim= c(2, 2, 1)), max = 2)

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

Successfully merging this pull request may close these issues.

2 participants