<?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: Display the all decimal value for numeric variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837813#M331286</link>
    <description>&lt;P&gt;What possible reason would you have to convert "all decimal places" of a number to character?&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 10:32:19 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-10-11T10:32:19Z</dc:date>
    <item>
      <title>Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837788#M331272</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to display the all decimals exist in numeric variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using below code to convert the numeric values to character to see how many decimals, but how the same values not populated in numeric variables AVAL and CHG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to display the all decimals for numeric variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data out;&lt;BR /&gt;&amp;nbsp; set in;&lt;/P&gt;&lt;P&gt;&amp;nbsp; aval_c=put(aval,best32.);&lt;BR /&gt;&amp;nbsp; chg_c=put(chg,best32.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raja777pharma_0-1665467098803.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76077i52AFD903A00D9895/image-size/large?v=v2&amp;amp;px=999" role="button" title="raja777pharma_0-1665467098803.png" alt="raja777pharma_0-1665467098803.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Rajasekhar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 05:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837788#M331272</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2022-10-11T05:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837792#M331273</link>
      <description>&lt;P&gt;What do you mean by "all decimals"?&lt;/P&gt;
&lt;P&gt;Mathematically, this is impossible, because most numbers have an infinite number of decimals (e.g. 1/3).&lt;/P&gt;
&lt;P&gt;Supply examples, and the intended (final) results.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 07:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837792#M331273</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-11T07:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837812#M331285</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309000"&gt;@raja777pharma&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309000"&gt;@raja777pharma&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How to display the all decimals for numeric variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data out;&lt;BR /&gt;&amp;nbsp; set in;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; aval_c=put(aval,best32.);&lt;BR /&gt;&amp;nbsp; chg_c=put(chg,best32.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raja777pharma_0-1665467098803.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76077i52AFD903A00D9895/image-size/large?v=v2&amp;amp;px=999" role="button" title="raja777pharma_0-1665467098803.png" alt="raja777pharma_0-1665467098803.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As a rule,&amp;nbsp;&lt;EM&gt;none&lt;/EM&gt; of the common numeric formats (BEST&lt;EM&gt;w&lt;/EM&gt;., &lt;EM&gt;w.d&lt;/EM&gt;, E&lt;EM&gt;w&lt;/EM&gt;., etc.) will show you "all decimals for numeric variables" in many cases. They all do some sort of rounding or truncation and thus conceal parts of the content of the variable. The easiest way to see what &lt;EM&gt;exactly&lt;/EM&gt; is contained in a numeric variable is to display it in a format such as HEX16. or BINARY64. showing the internal (binary floating-point) representation. This is sufficient for exact comparisons of two values, but you see only &lt;EM&gt;hexadecimal&lt;/EM&gt; or &lt;EM&gt;binary&lt;/EM&gt; digits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you want to see all&amp;nbsp;&lt;EM&gt;decimals&lt;/EM&gt;, you need to&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;translate the digit string which constitutes the internal representation into a &lt;EM&gt;number&lt;/EM&gt; written in the binary (or hexadecimal) system&lt;/LI&gt;
&lt;LI&gt;write this number in the decimal system.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The good news is that &lt;EM&gt;all&lt;/EM&gt;&amp;nbsp;(non-missing) values of numeric variables have a &lt;EM&gt;finite&lt;/EM&gt; decimal representation. So, cases like 1/3 with an infinite number of decimals do not occur. (As in the decimal system, 1/3 does not have a finite binary representation, whereas the internal representations are limited by the available 8 bytes for a numeric variable and hence are finite.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, I have not yet coded a function that displays the exact decimal value contained in a numeric variable (but this has been on my to-do list for quite a while), so for the time being this is a partly manual process using the BINARY64. format,&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961" target="_blank" rel="noopener"&gt;ChrisNZ&lt;/A&gt;&lt;SPAN&gt;'s macro CONVERTBASE attached to his 2020 post&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Converting-a-19-length-number-to-hex-and-then-to-a-string/m-p/653973/highlight/true#M196445" target="_blank" rel="noopener"&gt;Re: Converting a 19 length number to hex and then to a string&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;(only needed if there's a substantial integer part, not for your small example numbers) and mainly the function BASECONVFP that I posted in the same thread:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Converting-a-19-length-number-to-hex-and-then-to-a-string/m-p/654626/highlight/true#M196566" target="_blank" rel="noopener"&gt;...Converting-a-19-length-number-to-hex-and-then-to-a-string/m-p/654626/highlight/true#M196566&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Typically, &lt;EM&gt;several&lt;/EM&gt; different values of a numeric variable share the same BEST32. representation -- where "several" can be a small number like 5, but also a number in the millions (!). Contrary to naïve expectations, BEST32. is not always the best choice if you want to see the most precise value possible with a common, built-in format. I've seen many cases where BEST16. (!) or a suitable &lt;EM&gt;w.d&lt;/EM&gt; format was superior to BEST32. Also, the rarely used&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/n130tap9xs8q36n14gq23sci5y52.htm" target="_blank" rel="noopener"&gt;DECIMALCONV= system option&lt;/A&gt; has a substantial impact. With its default setting COMPATIBLE my Windows SAS 9.4M5 displays&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;    23 different values as  3.76082040434571
    11 different values as  4.04399223570895
184467 different values as -0.00029820160976
184467 different values as  0.00030661712631
&lt;/PRE&gt;
&lt;P&gt;in the BEST32. format. The DATA step below writes the first and last number of each of the four ranges and the neighboring internal representations with a different BEST32. display to the log:&lt;/P&gt;
&lt;PRE&gt;1158  data _null_;
1159  input x hex16.;
1160  put x hex16. x best32.;
1161  cards;

400E162902165AC2                 3.7608204043457
400E162902165AC3                3.76082040434571
400E162902165AD9                3.76082040434571
400E162902165ADA                3.76082040434572
40102D0C4CF69768                4.04399223570894
40102D0C4CF69769                4.04399223570895
40102D0C4CF69773                4.04399223570895
40102D0C4CF69774                4.04399223570896
BF338AFE295A46AF               -0.00029820160975
BF338AFE295A46B0               -0.00029820160976
BF338AFE295D1742               -0.00029820160976
BF338AFE295D1743               -0.00029820160977
3F34182E87A7320C                 0.0003066171263
3F34182E87A7320D                0.00030661712631
3F34182E87AA029F                0.00030661712631
3F34182E87AA02A0                0.00030661712632&lt;/PRE&gt;
&lt;P&gt;(The left column is identical to the data lines after the CARDS statement.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The smallest and largest internal representation displayed as &lt;FONT face="courier new,courier"&gt;3.76082040434571&lt;/FONT&gt; in BEST32. (&lt;FONT face="courier new,courier"&gt;400E162902165AC3&lt;/FONT&gt; and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;400E162902165AD9&lt;/FONT&gt;, resp.), i.e., like your first AVAL value, written in the decimal system, are:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;3.7608204043457&lt;/STRONG&gt;09189186663934378884732723236083984375
&lt;STRONG&gt;3.7608204043457&lt;/STRONG&gt;18959149280635756440460681915283203125&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;The difference between these two numbers equals &lt;FONT face="courier new,courier"&gt;11*2**-50=9.76996...E-15&lt;/FONT&gt;. As you can see, the BEST32. representation (ending in ...571) of the larger value is not mathematically rounded to ...572.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While those exact decimal representations are of interest to fans of long numbers (like me), the internal binary or hexadecimal representations are sufficient for most practical purposes, as mentioned earlier.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 15:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837812#M331285</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-13T15:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837813#M331286</link>
      <description>&lt;P&gt;What possible reason would you have to convert "all decimal places" of a number to character?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 10:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837813#M331286</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-11T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837944#M331327</link>
      <description>&lt;P&gt;&lt;STRONG&gt;The main point is they ARE the same values.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The issue is that you printed the original numbers using the BEST12. format and generated the string using the BEST32. format.&amp;nbsp; So of course they LOOK different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS can only store 15 decimal digits exactly.&amp;nbsp; If you want a method to generate a character variable that will result in the same value when converted back into a number then perhaps you want something like this?&lt;/P&gt;
&lt;P&gt;The basic idea is to figure out the magnitude of the number using the LOG base 10.&amp;nbsp; Then use that information decide how many digits you need to generate using the normal numeric format rather than the BEST format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input @1 B @1 raw $32.;
cards;
  3.76082040434571
  4.04399223570895
 -0.000298201609761234
  0.000306617126311234
  3.76082040434571
  37.6082040434571
  376.082040434571
;

data want;
  set have ;
  exp = floor(log10(abs(b)));
  bformat = cats('F',min(32,max(17,17-exp)),'.',min(31,max(0,14-exp)));
  bstring = putn(b,bformat);
  put  raw exp= b= :best32. / bstring /;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;475  data want;
476    set have ;
477    exp = floor(log10(abs(b)));
478    bformat = cats('F',min(32,max(17,17-exp)),'.',min(32,max(0,14-exp)));
479    bstring = putn(b,bformat);
480    put  raw exp= b= :best32. / bstring /;
481  run;

3.76082040434571 exp=0 B=3.76082040434571
3.76082040434571

4.04399223570895 exp=0 B=4.04399223570895
4.04399223570895

-0.000298201609761234 exp=-4 B=-0.00029820160976
-0.000298201609761234

0.000306617126311234 exp=-4 B=0.00030661712631
0.000306617126311234

3.76082040434571 exp=0 B=3.76082040434571
3.76082040434571

37.6082040434571 exp=1 B=37.6082040434571
37.6082040434571

376.082040434571 exp=2 B=376.082040434571
376.082040434571
&lt;/PRE&gt;
&lt;P&gt;So you can see the generated BSTRING values match exactly the original RAW strings read originally.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 20:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/837944#M331327</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-11T20:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838053#M331392</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;, for pointing out that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309000"&gt;@raja777pharma&lt;/a&gt;'s main issue was maybe just the difference between BEST12.- and BEST32.-formatted values. I hadn't thought it could be that simple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;If you want a method to generate a character variable that will result in the same value when converted back into a number then perhaps you want something like this?&lt;/P&gt;
&lt;P&gt;The basic idea is to figure out the magnitude of the number using the LOG base 10.&amp;nbsp; Then use that information decide how many digits you need to generate using the normal numeric format rather than the BEST format.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think even your fine approach cannot overcome the limitations of the common numeric formats (including the "normal" F&lt;EM&gt;w&lt;/EM&gt;.&lt;EM&gt;d&lt;/EM&gt;&amp;nbsp;format) that I mentioned in my previous post. In your examples the equality&lt;/P&gt;
&lt;PRE&gt;input(bstring, 32.)=b&lt;/PRE&gt;
&lt;P&gt;holds indeed. But often, as we all know, numeric values with that many decimals rather arise from &lt;EM&gt;calculations&lt;/EM&gt;&amp;nbsp;than from reading numeric literals. It appears that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309000"&gt;@raja777pharma&lt;/a&gt;'s AVAL and CHG values are a case in point. They appear to be base-10 logarithms of rational numbers:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have(keep=b);
input x y;
b=log10(y); output;
b=b-log10(x); output;
cards;
5769.24 5765.28
11058.23 11066.04
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using the above HAVE input dataset (whose values of &lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt;, viewed in BEST32. format, look exactly like the AVAL_C and CHG_C values from the initial post) the equality&amp;nbsp;&lt;FONT face="courier new,courier"&gt;input(bstring, 32.)=b&lt;/FONT&gt; breaks down in all four cases (at least on my Windows SAS 9.4M5).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For "a method to generate a character variable that will result in the same value when converted back into a number" I would suggest using the RB8. format:&lt;/P&gt;
&lt;PRE&gt;bstring=put(b, rb8.);&lt;/PRE&gt;
&lt;P&gt;Then the equality&lt;/P&gt;
&lt;PRE&gt;input(bstring, rb8.)=b&lt;/PRE&gt;
&lt;P&gt;should hold for all possible numeric values of &lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt; (including ordinary and special missing values). The HEX16. format/informat (which, unlike the RB8. format, are available in CAS) should work as well, except for special missing values.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 13:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838053#M331392</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-12T13:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838056#M331394</link>
      <description>&lt;P&gt;I suspect the intent was to have a human readable character string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To account for differences between numbers generated by calculations and reading text strings then perhaps you could replace the original numeric value with the value generated by reading back in the generated string?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 14:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838056#M331394</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-12T14:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838094#M331412</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;... perhaps you could replace the original numeric value with the value generated by reading back in the generated string?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To avoid a loss of accuracy I would rather try to find a numeric literal that, read by SAS, exactly matches the original value. On my computer the literals below (with 16-17 significant digits) satisfy this condition for the example numbers (logarithms).&lt;/P&gt;
&lt;PRE&gt; 3.760820404345718
-0.00029820160976035126
 4.043992235708956
 0.00030661712631019354&lt;/PRE&gt;
&lt;P&gt;For the two numbers close to zero the last decimal is not uniquely determined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be possible to create a user-defined format (based on a user-defined function) that yields such literals. Maybe that would be what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309000"&gt;@raja777pharma&lt;/a&gt;&amp;nbsp;needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Neither the decimal equivalents of the internal representations&lt;/P&gt;
&lt;PRE&gt; 3.760820404345718070970860935631208121776580810546875
-0.000298201609760351260547395213507115840911865234375
 4.0439922357089557181097916327416896820068359375
 0.00030661712631019355512762558646500110626220703125&lt;/PRE&gt;
&lt;P&gt;nor the 32-digit results (logarithms) of the Windows calculator&lt;/P&gt;
&lt;PRE&gt; 3.7608204043457181236947220335419
-2.9820160976030282536702286682087e-4
 4.0439922357089559295145311670842
 3.0661712631004661141724628180561e-4&lt;/PRE&gt;
&lt;P&gt;can substitute those literals.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 15:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838094#M331412</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-12T15:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838098#M331414</link>
      <description>&lt;P&gt;You seem to be trying to handle numbers that SAS cannot exactly represent because it uses 64 bit binary numbers.&lt;/P&gt;
&lt;P&gt;For example, that small negative number (-0.00029820160976035126) has more digits than SAS can exactly represent.&lt;/P&gt;
&lt;PRE&gt;633  data test;
634    integer=29820160976035126 ;
635    max_int=constant('exactint');
636    put (_all_) (=comma30./);
637  run;

integer=29,820,160,976,035,128
max_int=9,007,199,254,740,992
&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2022 16:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838098#M331414</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-12T16:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Display the all decimal value for numeric variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838280#M331425</link>
      <description>&lt;P&gt;Sure. Yet, reading this long literal -- and no shorter literal -- into a numeric variable by an assignment or INPUT statement (or by the INPUT function with informat 32.) yields the exact same internal representation as the expression&amp;nbsp;&lt;FONT face="courier new,courier"&gt;log10(5765.28)-log10(5769.24)&lt;/FONT&gt;. I know that &lt;EM&gt;too&lt;/EM&gt; long numeric literals can &lt;A href="https://communities.sas.com/t5/SAS-Programming/Expected-numeric-precision-behaviour-or-unexpected-issue/m-p/287071/highlight/true#M59008" target="_blank" rel="noopener"&gt;lead to unexpected results&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 18:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-the-all-decimal-value-for-numeric-variables/m-p/838280#M331425</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-12T18:12:01Z</dc:date>
    </item>
  </channel>
</rss>

