Home > Back-end >  How could I pass the byte bytes numerical calculate numerical?
How could I pass the byte bytes numerical calculate numerical?

Time:10-13

Use two bytes - value of 180 to 180, scale is 100, how to how the two bytes conversion to the actual value, don't know much about this, who is to say about how conversion, had better have the code,

CodePudding user response:

The actual value is a floating point number:
Short int X;//given two bytes are symbols of X;
Double + X=Y - 180 * 360/65535;//convert to - 180 to + 180 floating point between
Y *=100;

//scale is 100, this is not clear, the scale of the map scale and drawing the default value is different,
Want to write is clear, 100:1 or 1:100


  • Related