<?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: Floating point math in ksh93 in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051235#M94322</link>
    <description>You can of course use integer scaled math:&lt;BR /&gt;19720 * 100 / 1024&lt;BR /&gt;&lt;BR /&gt;Then you would have to add the "." before the 2 decimal places.&lt;BR /&gt;&lt;BR /&gt;Or you could use awk to do the calculation.</description>
    <pubDate>Wed, 08 Aug 2007 04:15:12 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-08-08T04:15:12Z</dc:date>
    <item>
      <title>Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051233#M94320</link>
      <description>&lt;BR /&gt;I need to be able to convert MB into GB, e.q. if I have 19720 MB, I need to know that it's 19.3 GB, not just 19 as ksh reports.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Aug 2007 10:52:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051233#M94320</guid>
      <dc:creator>dictum9</dc:creator>
      <dc:date>2007-08-07T10:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051234#M94321</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# cat .float&lt;BR /&gt;#!/usr/dt/bin/dtksh&lt;BR /&gt;typeset -F  R1&lt;BR /&gt;typeset -F3 R2&lt;BR /&gt;typeset -E  R3&lt;BR /&gt;let R1=1/8&lt;BR /&gt;echo ${R1}&lt;BR /&gt;let R2=1/8&lt;BR /&gt;echo ${R2}&lt;BR /&gt;let R3=1/8&lt;BR /&gt;echo ${R3}&lt;BR /&gt;# ./float&lt;BR /&gt;.1250000000&lt;BR /&gt;.125&lt;BR /&gt;0.125&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 07 Aug 2007 11:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051234#M94321</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-07T11:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051235#M94322</link>
      <description>You can of course use integer scaled math:&lt;BR /&gt;19720 * 100 / 1024&lt;BR /&gt;&lt;BR /&gt;Then you would have to add the "." before the 2 decimal places.&lt;BR /&gt;&lt;BR /&gt;Or you could use awk to do the calculation.</description>
      <pubDate>Wed, 08 Aug 2007 04:15:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051235#M94322</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-08-08T04:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051236#M94323</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;what would you do with decimals?&lt;BR /&gt;&lt;BR /&gt;you can't compare them:&lt;BR /&gt;$ [[ 1.2 -eq 1.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;ok&lt;BR /&gt;$ [[ 1.2 -gt 1.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;$ [[ 2.2 -gt 1.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;ok&lt;BR /&gt;$ [[ 2.2 -gt 2.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2007 04:27:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051236#M94323</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-08-08T04:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051237#M94324</link>
      <description>&amp;gt;Oviwan: what would you do with decimals?&lt;BR /&gt;&lt;BR /&gt;Did you read the subject?&lt;BR /&gt;Those commands work perfectly fine with /usr/dt/bin/dtksh</description>
      <pubDate>Wed, 08 Aug 2007 04:38:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051237#M94324</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-08-08T04:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051238#M94325</link>
      <description>ups you are right, sorry for confusion!&lt;BR /&gt;&lt;BR /&gt;$ /usr/dt/bin/dtksh&lt;BR /&gt;$ echo $0&lt;BR /&gt;/usr/dt/bin/dtksh&lt;BR /&gt;$ [[ 1.2 -gt 1.1 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;ok&lt;BR /&gt;$ [[ 1.1 -gt 1.1 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;$ [[ 2.1 -gt 1.1 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;ok&lt;BR /&gt;$ [[ 1.2 -eq 1.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;$ [[ 1.2 -gt 1.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;$  [[ 2.2 -gt 1.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;ok&lt;BR /&gt;$  [[ 2.2 -gt 2.5 ]] &amp;amp;&amp;amp; echo ok&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2007 04:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051238#M94325</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-08-08T04:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point math in ksh93</title>
      <link>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051239#M94326</link>
      <description>dtksh is ksh93 and like all shell scripts, you should specify the desired interpreter on line 1:&lt;BR /&gt; &lt;BR /&gt;#!/usr/dt/bin/dtksh&lt;BR /&gt; &lt;BR /&gt;# put your ksh code here&lt;BR /&gt; &lt;BR /&gt;ksh93 has a lot of enhancements over ksh88 (the /usr/bin/ksh in HP-UX) and the POSIX shell /usr/bin/sh. There are also some forward incompatibilities so be aware that a few techniques may need some changes. The dtksh shell was provided with add-on features for Xwindows but it's most useful feature today is ksh93 enhancements.</description>
      <pubDate>Wed, 08 Aug 2007 09:40:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/floating-point-math-in-ksh93/m-p/4051239#M94326</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-08-08T09:40:29Z</dc:date>
    </item>
  </channel>
</rss>

