<?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: computing limitation error - long and double in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132627#M688482</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The shell limits you to 32-bit arithmetic.  Use something like Perl or 'bc'.  For example:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'print +(2**52)'&lt;BR /&gt;4503599627370496&lt;BR /&gt;&lt;BR /&gt;# echo 2^52|bc&lt;BR /&gt;4503599627370496&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Mon, 29 Sep 2008 21:22:28 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-09-29T21:22:28Z</dc:date>
    <item>
      <title>computing limitation error - long and double</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132626#M688481</link>
      <description>I am writing a shell script to compute really long numbers. But due to limitation, it is giving out wrong numbers.&lt;BR /&gt;&lt;BR /&gt;I tried 'double' and 'long' as variable type but none of them are valid type.&lt;BR /&gt;&lt;BR /&gt;This is output.&lt;BR /&gt;&lt;BR /&gt;2847744950/3234344960 = 5295336 (huh??)&lt;BR /&gt;&lt;BR /&gt;Does anybody have any clue???&lt;BR /&gt;&lt;BR /&gt;Thanks a bunch.&lt;BR /&gt;&lt;BR /&gt;Yong&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Sep 2008 21:13:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132626#M688481</guid>
      <dc:creator>deCG</dc:creator>
      <dc:date>2008-09-29T21:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: computing limitation error - long and double</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132627#M688482</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The shell limits you to 32-bit arithmetic.  Use something like Perl or 'bc'.  For example:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'print +(2**52)'&lt;BR /&gt;4503599627370496&lt;BR /&gt;&lt;BR /&gt;# echo 2^52|bc&lt;BR /&gt;4503599627370496&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 29 Sep 2008 21:22:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132627#M688482</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-29T21:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: computing limitation error - long and double</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132628#M688483</link>
      <description>&amp;gt;JRF: The shell limits you to 32-bit arithmetic.&lt;BR /&gt;&lt;BR /&gt;ksh was changed in 11.23 to use 64 bit ints.  Unfortunately the posix shell wasn't changed.&lt;BR /&gt;&lt;BR /&gt;You can use awk to do calculations in double.&lt;BR /&gt;And gdb to do calculations in long double.&lt;BR /&gt;(gdb) p (long double)2847744950/3234344960&lt;BR /&gt;$2 = 0.88047038433401983194767202568275215</description>
      <pubDate>Tue, 30 Sep 2008 05:02:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132628#M688483</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-30T05:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: computing limitation error - long and double</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132629#M688484</link>
      <description>You guys are great... I will get back to you when I try at work...&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 30 Sep 2008 06:02:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132629#M688484</guid>
      <dc:creator>deCG</dc:creator>
      <dc:date>2008-09-30T06:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: computing limitation error - long and double</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132630#M688485</link>
      <description>.... ....</description>
      <pubDate>Tue, 30 Sep 2008 06:03:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132630#M688485</guid>
      <dc:creator>deCG</dc:creator>
      <dc:date>2008-09-30T06:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: computing limitation error - long and double</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132631#M688486</link>
      <description>thanks. it works now...</description>
      <pubDate>Wed, 01 Oct 2008 12:02:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/computing-limitation-error-long-and-double/m-p/5132631#M688486</guid>
      <dc:creator>deCG</dc:creator>
      <dc:date>2008-10-01T12:02:04Z</dc:date>
    </item>
  </channel>
</rss>

