When testing out some new layouts, I found myself writing at one point
.test1 {width: calc(50% + 0);}
and to my surprise, it didn't work.
After verifying that I didn't have a typo anywhere, I was forced to conclude that the browser rejected this as an error. Then I thought maybe it was a flaw in the browser I was testing with, but the other one behaves the same!
So what is it about this expression that is wrong? Where is the error?
p {border:2px solid green}
.test1 {width:calc(50% + 0);} /* wrong! */
.test2 {width:calc(50%);} /* OK */
.test3 {width:calc(50% + 0px);} /* also OK */
<p class="test1">test 1</p>
<p class="test2">test 2</p>
<p class="test3">test 3</p>
(By the way, let me assure you I have no intention of using this in production code; this is just something that came up in testing.)