<?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: Rounding all elements of an array in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041116#M219343</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1761918617863.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130390iC9269FD404D682D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1761918617863.png" alt="Werner_E_0-1761918617863.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Asking if x=0 is better done in round4, otherwise ....&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":angry_face_with_horns:"&gt;👿&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According fractional part of a number.&lt;/P&gt;
&lt;P&gt;The fractional part of x=9.99 clearly is 0.99 -&amp;gt; floor(x) + 0.99 = x&lt;/P&gt;
&lt;P&gt;But what should be considered the fractional part of x=-9.99 ??&lt;/P&gt;
&lt;P&gt;Should it be&lt;/P&gt;
&lt;P&gt;+0.99 as sign(x)*(floor(|x|)+0.99) = x&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;-0.99 as sign(x)*floor(|x|) -0.99 = x&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;+0.01 as floor(x)+0.01 = x&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to aunt Wiki (&lt;A href="https://en.wikipedia.org/wiki/Fractional_part" target="_self"&gt;Fractional part)&lt;/A&gt;&amp;nbsp; its -0.99 (as your function correctly returns) while +0.01 would be denoted by curly braces.&lt;/P&gt;
&lt;P&gt;Also uncle Wolfram (&lt;A href="https://mathworld.wolfram.com/FractionalPart.html" target="_blank"&gt;Fractional Part&lt;/A&gt;) uses -0.99 and so I guess we can say that your implementation follows the main stream.&lt;/P&gt;
&lt;P&gt;Looks like nobody likes my first intuition which would have been frac(-0.99)=+0.99 (just looking at the numbers after the decimal point and including the latter) &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Oct 2025 14:33:51 GMT</pubDate>
    <dc:creator>Werner_E</dc:creator>
    <dc:date>2025-10-31T14:33:51Z</dc:date>
    <item>
      <title>Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040807#M219294</link>
      <description>&lt;P&gt;I'm using WRITECSV to write the contents of a matrix to a .CSV file. The WRITECSV function writes the contents with full precision, giving me numbers with 18 decimal places. I want to round the elements to a few decimal places. I wrote a function to do this, but it feels kind of clunky. Is there a native way to accomplish what I'm trying to do? I'm using Prime 11.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MJ_10071773_0-1761769850720.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130311i6C828CFDEFCAE3CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MJ_10071773_0-1761769850720.png" alt="MJ_10071773_0-1761769850720.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 20:34:15 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040807#M219294</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-10-29T20:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040811#M219296</link>
      <description>&lt;P&gt;Oops, I realized that I redefined the native function "round". Not good. But my basic question remains.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 20:52:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040811#M219296</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-10-29T20:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040813#M219297</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025 10 29 A.png" style="width: 771px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130312i7C1C72C4876A64F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 29 A.png" alt="2025 10 29 A.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 20:54:29 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040813#M219297</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-29T20:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040817#M219299</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/997235"&gt;@MJ_10071773&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Oops, I realized that I redefined the native function "round". Not good. But my basic question remains.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wouldn't worry unduly about redefining the native function.&amp;nbsp; I do it almost all the time when I want the native function to do something different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, Mathcad will assign the "Variable" Label to your redefined function.&amp;nbsp; The original function is still available with different labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see or change a name's label, click on the name, then look in either the Math tab for Labels or in the Math Formatting tab (as seen in the image below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The tab should indicate the name's label.&amp;nbsp; The formatting tab lets you change a label's formatting to display it in a different colour or with a different attribute (bold, italic).&amp;nbsp; Unfortunately, you can't change a label's font or font size independently of the other labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I usually choose bold, green for the Function label, but I've changed it to red to make it stand out a bit better (hopefully).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be able to see in my previous post how it allows you to distinguish between the built-in &lt;FONT face="book antiqua,palatino" color="#008000"&gt;&lt;STRONG&gt;round&lt;/STRONG&gt; &lt;/FONT&gt;and both our redefined &lt;EM&gt;&lt;FONT face="book antiqua,palatino"&gt;round&lt;/FONT&gt;&lt;/EM&gt;s.&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="2025 10 29 C.png" style="width: 899px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130314i84D42A6B333CC658/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 29 C.png" alt="2025 10 29 C.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 21:16:50 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040817#M219299</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-29T21:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040827#M219301</link>
      <description>&lt;P&gt;Thank you! I learned more about Mathcad than I thought I would with this question.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 23:15:56 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040827#M219301</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-10-29T23:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040833#M219304</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/997235"&gt;@MJ_10071773&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No worries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/997235"&gt;@MJ_10071773&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I learned more about Mathcad than I thought I would with this question.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There's always something to learn, even if it's only through changes between versions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Funnily enough, I didn't realise (or, rather, had forgotten) that &lt;FONT face="book antiqua,palatino"&gt;&lt;STRONG&gt;&lt;FONT color="#008000"&gt;round&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;doesn't work over matrices until a couple of weeks ago.&amp;nbsp; It was rather frustrating hunting down the error in my program because I (&lt;EM&gt;naturally, IMO&lt;/EM&gt;) expected the rounding functions to vectorise over matrices.&amp;nbsp; It didn't occur to me that they only operated over scalars and vectors of scalars!&amp;nbsp; So, I added suitably modified versions of round, ceil, floor, etc, to my library of functions ... only to discover shortly afterwards that I already had versions in some older worksheets!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a few other functions that don't behave intuitively for me.&amp;nbsp; For example, &lt;FONT face="book antiqua,palatino"&gt;&lt;STRONG&gt;&lt;FONT color="#008000"&gt;stack&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;and&lt;/FONT&gt; &lt;FONT color="#008000"&gt;&lt;STRONG&gt;augment&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;don't work with ranges or functions.&amp;nbsp; I also miss the empty-array feature found in many other programming languages, so I've emulated it as well.&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="2025 10 29 D.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130316i00EFD9FF65209C20/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 29 D.png" alt="2025 10 29 D.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This next one probably doesn't interest many people, but I was again taken by surprise when I realised that the random number functions can't generate random complex variates, nor do they have a matrix-generation option, just a vector one.&amp;nbsp; Still, soon fixed.&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="2025 10 29 E.png" style="width: 611px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130318i7F734129EB70661E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 29 E.png" alt="2025 10 29 E.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The functions shown all run in Mathcad Express and Mathcad Prime.&amp;nbsp; (&lt;EM&gt;You might notice that I use a modified round function in imunif&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 23:49:37 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040833#M219304</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-29T23:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040962#M219312</link>
      <description>&lt;P&gt;Unfortunately, the element-wise rounding didn't accomplish my end goal. I wanted it to round the mantissa when working with numbers in scientific notation. Do you see an elegant way to accomplish that?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MJ_10071773_0-1761853480035.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130339i914C835835D369A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MJ_10071773_0-1761853480035.png" alt="MJ_10071773_0-1761853480035.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 19:45:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040962#M219312</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-10-30T19:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040965#M219313</link>
      <description>&lt;P&gt;Here was Chatgpt's solution to my question&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MJ_10071773_0-1761854216217.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130340iE414F0B175DD16EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MJ_10071773_0-1761854216217.png" alt="MJ_10071773_0-1761854216217.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I couldn't figure out how to incorporate the vectorization (element-wise) operator into the function definition.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 19:58:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040965#M219313</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-10-30T19:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040971#M219314</link>
      <description>&lt;P&gt;And after discovering a divide-by-zero limitation, I landed on this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MJ_10071773_1-1761855269459.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130342iE504F84C76CA6EC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MJ_10071773_1-1761855269459.png" alt="MJ_10071773_1-1761855269459.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 20:14:56 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040971#M219314</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-10-30T20:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040995#M219318</link>
      <description>&lt;P&gt;If you want to modify your function to vectorize over arrays, I'd use turn your function into a local function (roundsci, say) within roundSci, then vectorize over the call to it inside roundSci.&amp;nbsp; Unfortunately, I can't even create a program inside Mathcad Express so I can't show what I mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, here's another possibility that explicitly splits a number into the mantissa and exponent, rounds the mantissa and then combines them again.&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="2025 10 30 B.png" style="width: 685px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130349i4D5DD26085A086D7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 30 B.png" alt="2025 10 30 B.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 22:33:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1040995#M219318</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-30T22:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041007#M219322</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1761868008712.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130356i6DA987026245D49F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Werner_E_0-1761868008712.png" alt="Werner_E_0-1761868008712.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 23:47:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041007#M219322</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2025-10-30T23:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041010#M219325</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Aber natürlich.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wouldn’t mind, but I was only playing with complex numbers yesterday!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that’s Zen 3 and Zen 16 broken within an hour of posting the Zen of Mathcad! &lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 00:10:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041010#M219325</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-31T00:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041097#M219339</link>
      <description>&lt;P&gt;I was working in my lab, late last night&lt;BR /&gt;When my eyes beheld an eerie sight&lt;BR /&gt;For my monster from his slab, began to rise&lt;BR /&gt;And, suddenly, to my surprise&lt;BR /&gt;(He did the mash)&lt;BR /&gt;He did the Monster Mash ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, he didn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;He wandered over to the drinks cabinet and poured himself an 18-year-old Macallan single-malt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;I think Igor must have wired me up incorrectly, again.&lt;/EM&gt;", he remarked, conversationally.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Probably&lt;/EM&gt;," I noted, "&lt;EM&gt;but what makes you think so?&lt;/EM&gt;".&lt;BR /&gt;.&lt;BR /&gt;"&lt;EM&gt;Well, it's Igor. That's usually sufficient.&lt;/EM&gt;", he said, "&lt;EM&gt;But it's just that I thought there was a simpler way to carry out mantissa rounding. And what with my brain still being in beta test, I'm not sure I should be having such thoughts.&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Oh&lt;/EM&gt;.", sayeth I.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Yes&lt;/EM&gt;.", sayeth he, "&lt;EM&gt;Still, perhaps you'd like to try the idea out ... but I'd make your testing a bit more comprehensive, this time.&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Ah, yes. The villagers. The pitiful screams.&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;No. That goes with the territory, along with the pitchforks and burning torches.&lt;/EM&gt;", he said, "&lt;EM&gt;I was referring to The Curious Case of the Complex Logarithms that Bayed in the Night&lt;/EM&gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Oh&lt;/EM&gt;.", I said.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Quite&lt;/EM&gt;.", he said,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;You don't find that kind of thing going on in &lt;FONT face="times new roman,times" size="4"&gt;Schloß Werner&lt;/FONT&gt;&lt;/EM&gt;", he added reproachfully.&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="2025 10 31 A.png" style="width: 606px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130379iC80247E6B4BBD74A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 31 A.png" alt="2025 10 31 A.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Here be roundoff errors&lt;FONT size="4"&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025 10 31 D.png" style="width: 200px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130382iB31FF47A49028E76/image-size/small?v=v2&amp;amp;px=200" role="button" title="2025 10 31 D.png" alt="2025 10 31 D.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;FONT size="4"&gt;":&lt;/FONT&gt;&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="2025 10 31 B.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130380i8A0245136A039C7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 31 B.png" alt="2025 10 31 B.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More numerical shenanigans.&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="2025 10 31 C.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130381iE0AABD40D5EAB3E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 10 31 C.png" alt="2025 10 31 C.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 12:57:57 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041097#M219339</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-31T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041116#M219343</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1761918617863.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130390iC9269FD404D682D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1761918617863.png" alt="Werner_E_0-1761918617863.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Asking if x=0 is better done in round4, otherwise ....&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":angry_face_with_horns:"&gt;👿&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According fractional part of a number.&lt;/P&gt;
&lt;P&gt;The fractional part of x=9.99 clearly is 0.99 -&amp;gt; floor(x) + 0.99 = x&lt;/P&gt;
&lt;P&gt;But what should be considered the fractional part of x=-9.99 ??&lt;/P&gt;
&lt;P&gt;Should it be&lt;/P&gt;
&lt;P&gt;+0.99 as sign(x)*(floor(|x|)+0.99) = x&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;-0.99 as sign(x)*floor(|x|) -0.99 = x&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;+0.01 as floor(x)+0.01 = x&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to aunt Wiki (&lt;A href="https://en.wikipedia.org/wiki/Fractional_part" target="_self"&gt;Fractional part)&lt;/A&gt;&amp;nbsp; its -0.99 (as your function correctly returns) while +0.01 would be denoted by curly braces.&lt;/P&gt;
&lt;P&gt;Also uncle Wolfram (&lt;A href="https://mathworld.wolfram.com/FractionalPart.html" target="_blank"&gt;Fractional Part&lt;/A&gt;) uses -0.99 and so I guess we can say that your implementation follows the main stream.&lt;/P&gt;
&lt;P&gt;Looks like nobody likes my first intuition which would have been frac(-0.99)=+0.99 (just looking at the numbers after the decimal point and including the latter) &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 14:33:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041116#M219343</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2025-10-31T14:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041202#M219359</link>
      <description>&lt;P&gt;Yes, it would have been better to include the &lt;FONT face="book antiqua,palatino"&gt;x=0&lt;/FONT&gt; part in &lt;FONT face="book antiqua,palatino"&gt;round4&lt;/FONT&gt;.&amp;nbsp; TBH, I thought I had done, as well as adding the &lt;FONT face="book antiqua,palatino"&gt;x=0&lt;/FONT&gt; to some of the other &lt;FONT face="book antiqua,palatino"&gt;round{n}&lt;/FONT&gt; functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've corrected them in the attached Mathcad Express 10 worksheet ... I hope.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I chose &lt;FONT face="book antiqua,palatino"&gt;trunc&lt;/FONT&gt;&amp;nbsp;for&amp;nbsp;&lt;FONT face="book antiqua,palatino"&gt;frac&lt;/FONT&gt; on the basis that &lt;FONT face="book antiqua,palatino"&gt;trunc&lt;/FONT&gt;(&lt;FONT face="book antiqua,palatino"&gt;z&lt;/FONT&gt;) + &lt;FONT face="book antiqua,palatino"&gt;frac&lt;/FONT&gt;(&lt;FONT face="book antiqua,palatino"&gt;z&lt;/FONT&gt;) = &lt;FONT face="book antiqua,palatino"&gt;z&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, and I've moved frac to another worksheet entirely as part of a Mathcad Enhancement Proposal to extend the truncation and rounding functions (and mod) to matrices and with all complex arguments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Sat, 01 Nov 2025 00:51:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041202#M219359</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-11-01T00:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041476#M219413</link>
      <description>&lt;P&gt;Thanks, I really appreciate the time that you folks put into this! I ran into another problem. The rounding function didn't properly round complex numbers in scientific notation if the real and imaginary parts had different exponents. This is what I landed on. I went with the more verbose form so I wouldn't have to remember later what the native product function was &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MJ_10071773_0-1762190983213.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130520i1DF341854C7B066A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MJ_10071773_0-1762190983213.png" alt="MJ_10071773_0-1762190983213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 17:32:13 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041476#M219413</guid>
      <dc:creator>MJ_10071773</dc:creator>
      <dc:date>2025-11-03T17:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding all elements of an array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041484#M219415</link>
      <description>&lt;P&gt;??&lt;/P&gt;
&lt;P&gt;It looks to me that your picture shows that the numbers are correctly rounded to 3 significant digits, aren't they?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Ah, I see. You were referring to Stuarts original roundSci function.&lt;/P&gt;
&lt;P&gt;You may fix it a little bit shorter that way:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1762193507784.png" style="width: 627px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/130525i1095006BE8034BFC/image-dimensions/627x323?v=v2" width="627" height="323" role="button" title="Werner_E_0-1762193507784.png" alt="Werner_E_0-1762193507784.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 18:12:37 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Rounding-all-elements-of-an-array/m-p/1041484#M219415</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2025-11-03T18:12:37Z</dc:date>
    </item>
  </channel>
</rss>

