<?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: adding numbers don't add up.. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554390#M886549</link>
    <description>Due to the way floating point numbers are represented, the concept of precision is taken with a grain of salt.&lt;BR /&gt;&lt;BR /&gt;If you wish to calculate to exactly 2 decimal places, then scale an integer number (ie instead of 1.23 of "real" type, use 123 in integer). Thus in calculations your results will be precise. Convert to "real" only for printing.</description>
    <pubDate>Wed, 18 Jul 2001 15:34:50 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2001-07-18T15:34:50Z</dc:date>
    <item>
      <title>adding numbers don't add up..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554387#M886546</link>
      <description>I have a small C program that adds .01 to a number X times.&lt;BR /&gt;If the number is 1000, the result is 10.00, for 10000 the result is 100.00 but for higher numbers, the result is not correct (x=100000 gives 1000.67, x=1000000 gives 9865.22). What gives?</description>
      <pubDate>Wed, 18 Jul 2001 15:20:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554387#M886546</guid>
      <dc:creator>Dave Chamberlin</dc:creator>
      <dc:date>2001-07-18T15:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: adding numbers don't add up..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554388#M886547</link>
      <description>Hi Dave,&lt;BR /&gt;try double or long I am not sure. It is been long time.&lt;BR /&gt;&lt;BR /&gt;long flot x;&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Wed, 18 Jul 2001 15:32:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554388#M886547</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2001-07-18T15:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: adding numbers don't add up..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554389#M886548</link>
      <description>Dave,&lt;BR /&gt;&lt;BR /&gt;What datatype are you using for your additions?  If you're currently using a "float", then you may want to try using a "double" or "long double", because those have greater precision.&lt;BR /&gt;&lt;BR /&gt;I hope this helps.</description>
      <pubDate>Wed, 18 Jul 2001 15:34:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554389#M886548</guid>
      <dc:creator>Kenneth Platz</dc:creator>
      <dc:date>2001-07-18T15:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: adding numbers don't add up..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554390#M886549</link>
      <description>Due to the way floating point numbers are represented, the concept of precision is taken with a grain of salt.&lt;BR /&gt;&lt;BR /&gt;If you wish to calculate to exactly 2 decimal places, then scale an integer number (ie instead of 1.23 of "real" type, use 123 in integer). Thus in calculations your results will be precise. Convert to "real" only for printing.</description>
      <pubDate>Wed, 18 Jul 2001 15:34:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554390#M886549</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-07-18T15:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: adding numbers don't add up..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554391#M886550</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;setting&lt;BR /&gt;&lt;BR /&gt;double f=0.0;&lt;BR /&gt;&lt;BR /&gt;is sufficient.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 18 Jul 2001 15:51:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-numbers-don-t-add-up/m-p/2554391#M886550</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-07-18T15:51:25Z</dc:date>
    </item>
  </channel>
</rss>

