<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Typecasting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86728/typecasting</link><description>Hello, 
 I want to typecast an array of values from short to float. I am doing the below to do that 
 
 but when I am doing that, I am not able to get the float value as it is before typecasting. 
 what could be reason? 
 Do we loss values in typecasting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Apr 2022 13:48:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86728/typecasting" /><item><title>RE: Typecasting</title><link>https://devzone.nordicsemi.com/thread/362378?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 13:48:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3730847b-d6fb-4af7-84d7-aa2465f6fc28</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You do not show enough of your code to know exactly what you are doing (for instance not how you print). If you print as &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86711/printing-a-float-value/362316#362316"&gt;explained here&lt;/a&gt;, it should work though. For instance like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    int my_int = 123;
    float my_float = (float)my_int;
    NRF_LOG_INFO(&amp;quot;float value: &amp;quot; NRF_LOG_FLOAT_MARKER &amp;quot;\r\n&amp;quot;, NRF_LOG_FLOAT(my_float))&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>