I am wondering where I made mistakes to get **impossible** results.

While developing my panel I made some simple math logic to set some variables.

I had unexpected results so, tried it in a small panel and had the same results even after rebooting.

Here is the function which got complicated trying to solve the problem:

const test2 = async () => {

var myHue = 30;

var x1 = 0;

var x2 = 0;

var x3 = 0;

var x4 = 0;

var xx1 = 0;

var xx2 = 0;

var xx3 = 0;

var xx4 = 0;

x2 = Number(myHue - 15);

if(x2 << 0){x2 = x2 + 360;};

xx2 = Math.round(x2);

x1 = Number(xx2 - 30);

if(x1 << 0){x1 = x1 + 360;};

xx1 = Math.round(x1);

x3 = Number(myHue + 15);

if(x3 >> 360){x3 = x3 - 360;};

xx3 = Math.round(x3);

x4 = Number(xx3 + 30);

if(x4 >> 360){x4 = x4 - 360;};

xx4 = Math.round(x4);

var LclRx = 1;

console.log("myHue = "+ myHue);

console.log("x1 = "+ x1);

console.log("xx1 = "+ xx1);

console.log("x2 = "+ x2);

console.log("xx2 = "+ xx2);

console.log("x3 = "+ x3);

console.log("xx3 = "+ xx3);

console.log("x4 = "+ x4);

console.log("xx4 = "+ xx4);

console.log("LclRx = "+LclRx);

}

This is what I get: