What is the result ? 0..5 - 2 =?

0..5 - 2 = ?

A. err
B. -2..3 ?
C. 0..3

why?
impl Add for Range ???

Why ask such a trivial question when you could just debug-print it yourself?

(It's precedence. .. has lower precedence than subtraction.)

4 Likes

https://doc.rust-lang.org/beta/reference/expressions.html#expression-precedence

4 Likes

Sorry to complicate the problem

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.