Acknowledged

Connect IQ Reference Manual errors

The Connect IQ Reference Manual SDK 7.4.3 in the section on Monkey C operators misses out the << and >> operators. It also incorrectly describes the >>= operator as follows:

>>=   Right shift the right operand by the left operand and assign the result to the left operand

This should be:

>>=   Right shift the left operand by the right operand and assign the result to the left operand

Also, the descriptions of /= and %= say:

"Divide the right operand from the left operand..."

but should be:

"Divide the left operand by the right operand..."

Maybe I missed it, but it would be nice to know is there is a way to do integer division without conversion to floating point. 

On the whole though, the SDK documentation is excellent.

Regards, Michael

Parents Comment Children
  • And if one of the values is a Float, the result is a Float:

    Consider this

            var i=9/5;
            var f=9.0/5;
            System.println(""+i+" "+f);
            if(i instanceof Number) {System.println("i is a Number");}
            if(i instanceof Float) {System.println("i is a Float");}
            if(f instanceof Number) {System.println("f is a Number");}
            if(f instanceof Float) {System.println("f is a Float");}
    The output is this

    1 1.800000
    i is a Number
    f is a Float