Login  Register

Perhaps a tiny Macro bug...

Posted by Richard VanMetter on Feb 20, 2017; 11:47pm
URL: http://imagej.273.s1.nabble.com/Perhaps-a-tiny-Macro-bug-tp5018154.html

I am preparing to teach a short course in ImageJ. While creating a slide
illustrating operator precedence in the macro language, I discovered that

a = 3 * (++2);
print(a);

     evaluates (I believe) incorrectly to 7.

b = 2;
a = 3 * (++b);
print(b);

     evaluates correctly to 9

While my construction using (++2) is unlikely to ever be used, I pass
this along in the belief that no bug is too small to ignore.

ImageJ 1.51j; Java 1.8.0_112 [64-bit]

Regards,

Rich VanMetter

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html