Goksel Sunar Posted October 16, 2015 Report Posted October 16, 2015 Hi plane AP heading value = 100 in the fsuipc log screen show = 07CC (u16) 18204 calculated AP heading value = 18204 *360 / 65536 = 99,99755859375 How can i get integer value (100) . Should i round this value ?
Pete Dowson Posted October 16, 2015 Report Posted October 16, 2015 Hi plane AP heading value = 100 in the fsuipc log screen show = 07CC (u16) 18204 calculated AP heading value = 18204 *360 / 65536 = 99,99755859375 How can i get integer value (100) . Should i round this value ? The normal method is to round to the nearest integer: i.e. add 0.5 and take the integer part. Pete
Goksel Sunar Posted October 17, 2015 Author Report Posted October 17, 2015 Thank you , Pete. this csharp code is working . Maybe usefull for some one. private Offset<UInt16> APHeadingValue= new Offset<UInt16>(0x07CC); Get: txtApHeadingValue.Text = ((int)((APHeadingValue.Value+0.5)*360/65536)).ToString(); Set: "70 degree" APHeadingValue.Value = (70 * 65536 / 360);
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now