<?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 round() function bug in Fusion Support Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7954669#M177863</link>
    <description>&lt;P&gt;The following expressions produce different results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;round(4) * 1 mm = 4
round(4 mm) = 0

round(5) * 1 mm = 5
round(5 mm)  = 10

round(15.2) * 1 mm = 15
round(15.2 mm)  = 20&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;As you can see, when the units are &lt;EM&gt;inside&lt;/EM&gt; the brackets, Fusion rounds to the nearest 10 rather than the nearest whole number. This doesn't seem to happen with other functions such as &lt;STRONG&gt;abs()&lt;/STRONG&gt;. The workaround is to ensure the units are outside the brackets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The following screenshot shows the actual results in Fusion:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Round function problem.png" style="width: 626px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/492461i3C66E6A077666C23/image-dimensions/626x335?v=v2" width="626" height="335" role="button" title="Round function problem.png" alt="Round function problem.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Why this is a big problem:&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; If the argument to the round() function is a variable,&amp;nbsp;the value assigned to the variable will usually be a dimension &lt;EM&gt;with units&lt;/EM&gt;, e.g. 5 mm, which also causes the problem to happen:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WasherThickness = 0.8 mm
WasherSocketDepth= round(WasherThickness+0.2)  * 1 mm&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;In this case&amp;nbsp;putting the units outside the brackets doesn't work becasue the variable already has its own units, which would results in mm²:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WasherThickness = 0.8 mm
WasherSocketDepth= round(WasherThickness+0.2) * 1 mm &lt;FONT color="#FF0000"&gt;; Error!&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 07:01:52 GMT</pubDate>
    <dc:creator>Scoox</dc:creator>
    <dc:date>2018-04-24T07:01:52Z</dc:date>
    <item>
      <title>round() function bug</title>
      <link>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7954669#M177863</link>
      <description>&lt;P&gt;The following expressions produce different results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;round(4) * 1 mm = 4
round(4 mm) = 0

round(5) * 1 mm = 5
round(5 mm)  = 10

round(15.2) * 1 mm = 15
round(15.2 mm)  = 20&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;As you can see, when the units are &lt;EM&gt;inside&lt;/EM&gt; the brackets, Fusion rounds to the nearest 10 rather than the nearest whole number. This doesn't seem to happen with other functions such as &lt;STRONG&gt;abs()&lt;/STRONG&gt;. The workaround is to ensure the units are outside the brackets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The following screenshot shows the actual results in Fusion:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Round function problem.png" style="width: 626px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/492461i3C66E6A077666C23/image-dimensions/626x335?v=v2" width="626" height="335" role="button" title="Round function problem.png" alt="Round function problem.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Why this is a big problem:&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; If the argument to the round() function is a variable,&amp;nbsp;the value assigned to the variable will usually be a dimension &lt;EM&gt;with units&lt;/EM&gt;, e.g. 5 mm, which also causes the problem to happen:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WasherThickness = 0.8 mm
WasherSocketDepth= round(WasherThickness+0.2)  * 1 mm&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;In this case&amp;nbsp;putting the units outside the brackets doesn't work becasue the variable already has its own units, which would results in mm²:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WasherThickness = 0.8 mm
WasherSocketDepth= round(WasherThickness+0.2) * 1 mm &lt;FONT color="#FF0000"&gt;; Error!&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 07:01:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7954669#M177863</guid>
      <dc:creator>Scoox</dc:creator>
      <dc:date>2018-04-24T07:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: round() function bug</title>
      <link>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7956449#M177864</link>
      <description>&lt;P&gt;Yes, this is a known issue.&amp;nbsp; Originally, these functions were assumed to always get "unitless" inputs.&amp;nbsp; So, they did not work correctly with length parameters.&amp;nbsp; This is being actively enhanced to allow them to be units aware.&amp;nbsp; Once this fix is released, "round(4.2 mm)" will work as expected, and return "4.0 mm".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 18:22:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7956449#M177864</guid>
      <dc:creator>jeff_strater</dc:creator>
      <dc:date>2018-04-24T18:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: round() function bug</title>
      <link>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7957144#M177865</link>
      <description>Thanks Jeff</description>
      <pubDate>Wed, 25 Apr 2018 00:43:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-support-forum/round-function-bug/m-p/7957144#M177865</guid>
      <dc:creator>Scoox</dc:creator>
      <dc:date>2018-04-25T00:43:28Z</dc:date>
    </item>
  </channel>
</rss>

