Hi.

I'm stuck with variables format. I know this is a stupid question but I'm on it for 2 hours and I'm losing my mind.

I began in this programing stuff maybe 2 months ago, so I'm really new at it.

The problem is:

I have:

command.Data = new ushort[] { xx, yy, zz };

And I need to do:

ushort zz = System.Math.Tan(c1AngleX);

But the output of System.Math.Tan is "double", so I kinda can't have the "ushort" there.

I tried this

ushort zz = (Convert.ToUInt16 (System.Math.Tan(c1AngleX));

But I can't.

There's any way to convert "double" to "ushort"?