<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dble() changes value in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942702#M17422</link>
    <description>It DOES set the rest of the mantissa to zero - binary zero!  That's not the same as decimal zero!  (Look for an article in our upcoming newsletter that discusses this issue in general - it will be available to registered users only.)&lt;BR /&gt;&lt;BR /&gt;Once you have assigned a REAL*4 value, there's no way to "create" the extra precision that a REAL*8 value would have had.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Thu, 15 Mar 2001 00:55:53 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2001-03-15T00:55:53Z</dc:date>
    <item>
      <title>dble() changes value</title>
      <link>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942701#M17421</link>
      <description>Hi,   &lt;BR /&gt;I'm wondering, how to get exact same real*8 number from real*4 numbers. Example:   &lt;BR /&gt;      real*4 x4   &lt;BR /&gt;      real*8 x8,y8         &lt;BR /&gt;      x4=2.7   &lt;BR /&gt;      x8=dble(x4)   &lt;BR /&gt;      y8=2.7d0   &lt;BR /&gt;      write(*,*) x4, x8, y8   &lt;BR /&gt;      end   &lt;BR /&gt;gives:   &lt;BR /&gt;   2.700000       2.70000004768372        2.70000000000000        &lt;BR /&gt;   &lt;BR /&gt;So,shouldnt dble() initialize the rest of the mantissa to zero to have x8=x4 in common sense (y8 shows, this number exist :)   &lt;BR /&gt;   &lt;BR /&gt;Cite from dble(a) documentaton in CVF:   &lt;BR /&gt;"If a is of type integer or real, the result has as much precision of the significant part of a as a double precision value can contain."   &lt;BR /&gt;   &lt;BR /&gt;Any work-around, which stands optimization ?   &lt;BR /&gt;   &lt;BR /&gt;Thanks   &lt;BR /&gt;Martin</description>
      <pubDate>Wed, 14 Mar 2001 19:36:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942701#M17421</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-14T19:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: dble() changes value</title>
      <link>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942702#M17422</link>
      <description>It DOES set the rest of the mantissa to zero - binary zero!  That's not the same as decimal zero!  (Look for an article in our upcoming newsletter that discusses this issue in general - it will be available to registered users only.)&lt;BR /&gt;&lt;BR /&gt;Once you have assigned a REAL*4 value, there's no way to "create" the extra precision that a REAL*8 value would have had.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 15 Mar 2001 00:55:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942702#M17422</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-03-15T00:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: dble() changes value</title>
      <link>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942703#M17423</link>
      <description>Thanks for your prompt answer. But ... &lt;BR /&gt; &lt;BR /&gt;The consequence of this unpredictable 'binary' addon: no local change to double precision, e.g. in critical functions wich handle small differences of large numbers. I have constructed a small example, where double precision results in larger error than staying in single precision. &lt;BR /&gt; &lt;BR /&gt;You mentioned a newsletter article, I guess not out yet. Any chance to get an idea how to get rid of that problem ? (I'm registrated, email ok) &lt;BR /&gt; &lt;BR /&gt;Martin</description>
      <pubDate>Thu, 15 Mar 2001 01:22:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942703#M17423</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-15T01:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: dble() changes value</title>
      <link>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942704#M17424</link>
      <description>It's not unpredictable - it's VERY predictable.  DBLE will zero-extend the fraction from single-precision to double-precision with binary zeroes.  You evidently want decimal zeroes added - that's not the way it works.  (And if you had assigned x8=x4, you'd see the same thing.)&lt;BR /&gt;&lt;BR /&gt;My first suggestion would be to use double precision throughout your application, being sure to use the D0 form of constants.  You could also do a conversion as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="+1"&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;character*13 buff&lt;BR /&gt;...&lt;BR /&gt;write (buff,'(E13.6)') x4&lt;BR /&gt;read (buff,'(E13.6)') x8&lt;BR /&gt;&lt;BR /&gt;That should extend the value with decimal zeroes.&lt;BR /&gt;&lt;BR /&gt;I expect the newsletter to be out in a week or so.  Watch your e-mail for the pointer.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/CODE&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 15 Mar 2001 02:34:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dble-changes-value/m-p/942704#M17424</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-03-15T02:34:33Z</dc:date>
    </item>
  </channel>
</rss>

