I am learning to use fract type.
fract16 x = 0.5r16; // it works ok
fract16 x = -0.5r16; //I receive a warning cc0069: integer convertion resulted in truncation
why does this warning occur?
I run my code in BF533 with vdsp5.0
I believe you are hitting a bug in the VisualDSP++ tools where a warning is issued unnecessarily. As you will see, when you run your code the variable x takes on the correct value of 0xc000, so this can be ignored in this case.
I would recommend downloading and installing the latest update, Update 9.1. Not only is the bug fixed, but Update 9 also introduced improved fractional (fixed point) support. Please take a look at the release note, and download the update from the following page:
It is amazing that _Fract becomes a native type in new updates.
Thank you for your answer and introduction.
Retrieving data ...