<?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: Scientific notation in BESTw. Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774397#M246126</link>
    <description>&lt;P&gt;zeros are not significant digits then...&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 00:36:31 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-10-15T00:36:31Z</dc:date>
    <item>
      <title>Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773958#M245930</link>
      <description>&lt;P&gt;This is a Windows 64bit environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the following program is executed, the&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  value=12345678;
  put 'best4.&amp;gt; ' value best4. /
      'best5.&amp;gt; ' value best5. /
      'best6.&amp;gt; ' value best6. /
      'best7.&amp;gt; ' value best7.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The results are as follows&lt;/P&gt;
&lt;PRE&gt;best4.&amp;gt; 12E6
best5.&amp;gt; 123E5
best6.&amp;gt; 1.23E7
best7.&amp;gt; 1.235E7&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here we see that&lt;BR /&gt;Why does best5 format print as 123E5 instead of 1.2E7?&lt;BR /&gt;Why does best6 format print as 1.23E7 instead of 1234E4?&lt;BR /&gt;I can't figure it out by looking at &lt;A href="https://documentation.sas.com/doc/ja/pgmsascdc/9.4_3.5/leforinforref/p1fum54c93f8r0n1wrs5mrb05nzi.htm" target="_blank" rel="noopener"&gt;Help&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The printed results of best5 format. and best6. are different in expression, but they have the same value, right?(12300000)&lt;BR /&gt;Since the length of the format changes, doesn't the number of significant digits also change?&lt;BR /&gt;Why is it that the number of significant digits changes, but the actual value is the same?&lt;BR /&gt;I don't get it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone knows, please let me know.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773958#M245930</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-10-13T15:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773960#M245932</link>
      <description>&lt;P&gt;The BEST format exponential notation doesn't care about "significant digits" as so many users have different rules for what is significant.&lt;/P&gt;
&lt;P&gt;If you care, then do not use BEST formats which uses general rules, based on ranges of values, to display values within a fixed number of characters. Use the E format if want to control things a bit better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should include negative values when playing with such examples as well to see what effect the extra character for negative does to values.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773960#M245932</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-13T15:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773961#M245933</link>
      <description>&lt;P&gt;The idea of the BEST format is that it will pick the best way to display the value in the number of characters you requested.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;"123E5" is better than "1.2E7" because&amp;nbsp;&lt;/SPAN&gt;by eliminating the decimal point it can include one extra digit and still fit into only 5 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would have to talk to SAS about how SAS decides what is "BEST".&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773961#M245933</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-10-13T15:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773969#M245938</link>
      <description>Thanks.&lt;BR /&gt;I've tried outputting best1-32 for various numbers, negative numbers of course, and numbers with decimals, but I couldn't figure out the law at all.&lt;BR /&gt;I don't want to know how to display the values, I simply want to know the law of exponential notation in BEST format.&lt;BR /&gt;Why? Is it because I am a spec idiot? &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773969#M245938</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-10-13T15:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773970#M245939</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;The idea of the BEST format is that it will pick the best way to display the value in the number of characters you requested.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;"123E5" is better than "1.2E7" because&amp;nbsp;&lt;/SPAN&gt;by eliminating the decimal point it can include one extra digit and still fit into only 5 characters.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Based on your way of thinking, it seems that 1234E4 would be superior to 1.23E7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;You would have to talk to SAS about how SAS decides what is "BEST".&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think that's exactly right, but this kind of "specification" is not disclosed to the public.&lt;BR /&gt;So, I tried to guess from the results, but I couldn't figure it out.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773970#M245939</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-10-13T15:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773981#M245945</link>
      <description>&lt;P&gt;And given how SAS normally maintains backwards compatibility they are not likely to change the algorithm to start having 12345678 display with BEST6. as "1234E4" instead of "1.23E7".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 16:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/773981#M245945</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-10-13T16:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774061#M245960</link>
      <description>&lt;P&gt;The logic as length grows seems to be: Add significant digits, when you have 3 significant digits, add a decimal point, and then add more digits.&lt;/P&gt;
&lt;P&gt;That's just what the format does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 23:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774061#M245960</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-10-13T23:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774248#M246055</link>
      <description>&lt;P&gt;That tends to be the case.&lt;/P&gt;
&lt;P&gt;The rest seems to depend on the value, as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  a=10000;
  put a=best4.;
  a=11000;
  put a=best4.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;a=1E4
a=11E3&lt;/PRE&gt;
&lt;P&gt;lol&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 15:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774248#M246055</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-10-14T15:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scientific notation in BESTw. Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774397#M246126</link>
      <description>&lt;P&gt;zeros are not significant digits then...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 00:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scientific-notation-in-BESTw-Format/m-p/774397#M246126</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-10-15T00:36:31Z</dc:date>
    </item>
  </channel>
</rss>

