Forum Discussion
abaxor
New Contributor
4 years agoHow to convert an ihc::hls_float <8, 23> s_tanf to an ac_int or ac_fixed?
Hi,
I have to calculate an arctan on a CycloneV. Since HLS/ac_fixed_math.h does not include atan I use HLS/hls_float_math.h. Just now I run in trouble to convert the
ihc::hls_float <8, 23> s_tan...
aikeu
Regular Contributor
4 years agoHi abaxor,
hls_float <8, 23> s_tanf is using IEEE 754 single-precision (binary32), 32bit to represent the data in binary value:
https://www.geeksforgeeks.org/ieee-standard-754-floating-point-numbers/
As for the ac_int and ac_fixed convertion, you can refer better to the below:
You can use any online IEEE-754 Floating Point Converter to test out the results of value you would like to convert and check if you are getting the correct output in your code based on how the value is defined with ac_int/ac_fixed.
Thanks.
Regards,
Aik Eu