<?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: FLOOR vs. INT function different? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849835#M335933</link>
    <description>&lt;P&gt;According to the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p1b1zd0wuyufp0n1jbqlr27p4eay.htm" target="_self"&gt;INT documentation&lt;/A&gt; (which you should be reading before you ask, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431484"&gt;@Nietzsche&lt;/a&gt;)&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INT function returns the integer portion of the argument (truncates the decimal portion). If the argument's value is within 1E-12 of an integer, the function results in that integer. If the value of &lt;EM class="xisDoc-userSuppliedValue"&gt;argument&lt;/EM&gt; is positive, the INT function has the same result as the FLOOR function. If the value of &lt;EM class="xisDoc-userSuppliedValue"&gt;argument&lt;/EM&gt; is negative, the INT function has the same result as the CEIL function.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Thu, 15 Dec 2022 11:13:11 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-12-15T11:13:11Z</dc:date>
    <item>
      <title>FLOOR vs. INT function different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849818#M335922</link>
      <description>&lt;P&gt;FLOOR function returns the largest integer that is less than or equal to the argument while INT function removes any values after the decimal places.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in terms of the final result, ain't they exact the same? Are there any situations where you should one function over the other?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see example with sashelp.tourism&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data temp;
	set sashelp.tourism;
		floor = floor(vsp);
		int = int(vsp);
run;

proc print data=temp;
var vsp floor int;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1671098871560.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78568i71F16F393927279D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_0-1671098871560.png" alt="Nietzsche_0-1671098871560.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 10:27:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849818#M335922</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-12-15T10:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: FLOOR vs. INT function different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849823#M335925</link>
      <description>&lt;P&gt;No. Consider the case of negative numbers. In that case, the results will differ&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   do _N_ = 1 to 10;
      x = rand('uniform', -10, 10);
      output;
   end;
   format x 8.2;
run;

data want;
   set have;
   int   = int(x);
   floor = floor(x);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 10:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849823#M335925</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-12-15T10:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: FLOOR vs. INT function different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849835#M335933</link>
      <description>&lt;P&gt;According to the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p1b1zd0wuyufp0n1jbqlr27p4eay.htm" target="_self"&gt;INT documentation&lt;/A&gt; (which you should be reading before you ask, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431484"&gt;@Nietzsche&lt;/a&gt;)&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INT function returns the integer portion of the argument (truncates the decimal portion). If the argument's value is within 1E-12 of an integer, the function results in that integer. If the value of &lt;EM class="xisDoc-userSuppliedValue"&gt;argument&lt;/EM&gt; is positive, the INT function has the same result as the FLOOR function. If the value of &lt;EM class="xisDoc-userSuppliedValue"&gt;argument&lt;/EM&gt; is negative, the INT function has the same result as the CEIL function.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 11:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849835#M335933</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-15T11:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: FLOOR vs. INT function different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849838#M335934</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;has given the most important difference. For more information about various ways to round numbers in SAS, see &lt;A href="https://blogs.sas.com/content/iml/2011/10/03/rounding-up-rounding-down.html" target="_self"&gt;"Rounding up, rounding down."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Engineers often use a method known as &lt;A href="https://blogs.sas.com/content/iml/2019/11/11/round-to-even.html" target="_self"&gt;the round-to-even method,&lt;/A&gt;&amp;nbsp;which is also supported in SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 11:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLOOR-vs-INT-function-different/m-p/849838#M335934</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-12-15T11:32:57Z</dc:date>
    </item>
  </channel>
</rss>

