[Rd] Bug Report: Incorrect precedence between / and %/% in R 4.4.1

Lionel Fotie ||one|@|ot|e @end|ng |rom groupm@com
Fri Jan 31 14:35:14 CET 2025


Dear R Development Team,

I have encountered an unexpected behavior in R 4.4.1 regarding the precedence of / and %/%.

Steps to reproduce:
print(2 * 10 / 2 %/% 50)

Expected result:
Since *, / and %/% have the same precedence, evaluation should be left-to-right:
(2 * 10) / 2 %/% 50  # Expected: 0

Actual result:
[1] Inf

Workaround:
Adding explicit parentheses fixes the issue:
print(((2 * 10) / 2) %/% 50)  # Returns 0 (as expected)

This suggests that %/% is evaluated before /, contradicting the expected left-associativity.
Could you please confirm if this is a known issue ?

Best regards,

LIONEL FOTIE
Data Scientist
-
GroupM Germany GmbH
-
Office: +49211 81991563
V�lklinger Stra�e 33 | 40221 D�sseldorf | Germany
-
Join us: Karriere <https://karriere.groupm.de/de> | www.groupm.de<https://www.groupm.de/>
Follow us: Facebook<https://www.facebook.com/GroupMGermany> | X<https://twitter.com/GroupMGermany> | Xing<https://www.xing.com/companies/groupmgermanygmbh> | LinkedIn<https://www.linkedin.com/company/groupm-germany/> | Instagram<https://www.instagram.com/groupm_germany/?hl=de>


	[[alternative HTML version deleted]]



More information about the R-devel mailing list