virote328 wrote
Hi guys.
In the JACK language, how is one supposed to detect negative numbers?
I went over the Math class and noticed that the book shows examples of multiplication for positive integers. And it got me thinking.... how does jack detect a negative number in the first place?
Easiest Jack code to detect if
x is negative is
if (x < 0)For Math.multiply() you don't need to worry about signs. See comment in 12.3.1.
--Mark