Hi Gordon,
It was not easy to isolate the following problem:
The Code:
a=16; b=16; console.log('A:'+a); console.log('B:'+b); console.log('AND Result1:'+(a&b));
a=16; b=Math.pow(2,4); // Also 16 console.log('A:'+a); console.log('B:'+b); console.log('AND Result2:'+(a&b));
Espruino Output:
1v63 Copyright 2014 G.Williams
echo(0); A:16 B:16 AND Result1:16 A:16 B:16 AND Result2:0 =undefined
On jsoncole.com, the output is the following. See "AND Result2", should be 16 too.
A:16 B:16 AND Result1:16 A:16 B:16 AND Result2:16
See http://jsconsole.com/?a%3D16%3B%0Ab%3D16%3B%0Aconsole.log(%27A%3A%27%2Ba)%3B%0Aconsole.log(%27B%3A%27%2Bb)%3B%0Aconsole.log(%27AND%20Result1%3A%27%2B(a%26b))%3B%0A%0Aa%3D16%3B%0Ab%3DMath.pow(2%2C4)%3B%0Aconsole.log(%27A%3A%27%2Ba)%3B%0Aconsole.log(%27B%3A%27%2Bb)%3B%0Aconsole.log(%27AND%20Result2%3A%27%2B(a%26b))%3B
Thanks
Sacha
@Sacha started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi Gordon,
It was not easy to isolate the following problem:
The Code:
a=16;
b=16;
console.log('A:'+a);
console.log('B:'+b);
console.log('AND Result1:'+(a&b));
a=16;
b=Math.pow(2,4); // Also 16
console.log('A:'+a);
console.log('B:'+b);
console.log('AND Result2:'+(a&b));
Espruino Output:
1v63 Copyright 2014 G.Williams
On jsoncole.com, the output is the following. See "AND Result2", should be 16 too.
A:16
B:16
AND Result1:16
A:16
B:16
AND Result2:16
See http://jsconsole.com/?a%3D16%3B%0Ab%3D16%3B%0Aconsole.log(%27A%3A%27%2Ba)%3B%0Aconsole.log(%27B%3A%27%2Bb)%3B%0Aconsole.log(%27AND%20Result1%3A%27%2B(a%26b))%3B%0A%0Aa%3D16%3B%0Ab%3DMath.pow(2%2C4)%3B%0Aconsole.log(%27A%3A%27%2Ba)%3B%0Aconsole.log(%27B%3A%27%2Bb)%3B%0Aconsole.log(%27AND%20Result2%3A%27%2B(a%26b))%3B
Thanks
Sacha