What is definition of value mentioned in, for example, string(variableName | value)? Are value and expression same? It looks like that value can take the form 32 * 12 * multiplier.
What can be value of right hand side of arithmetic = operator?
Hey Minh-Nhut Hong,
The following calls to string were provided as examples in the problem definition:
var str3 = string(35 + 12);
string(32 * 12 * multiplier);
string(3450.212);
string(double);
string(result);
var str3 = string(35 + 12);
var str4 = "result: " + string(50 / 2);
output("srq: " + string(sqrt(30)));
output("Value for a: " + string(a));
output("Value for b: " + string(b));
var message = "a / b = ";
message = message + string(a / b);
Rama already provided the answer to your question. However, I just wanted to provide some extra feedback. If you take a look at all the examples provided, you'll understand how things must work.
Cheers,
Gaston
Once again I'd like to be able to implement a general unary expression or special-case leading negative and be assured that problem set will not explicitly require syntax error on input like:
var c = -(a+b);
What's the point of unary negation? Why add more complexity to this already out of hand syntax when there is so little time left to implement a solution?
My vote goes for 0 - 1 style negation. It gets the job done without changing the spec.