cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Lusk_Rounding to Significant Figures.zip

FredLusk
12-Amethyst

Lusk_Rounding to Significant Figures.zip

I recently posted a worksheet titled Lusk_Logspace Function and SigFigs.mcdx here in the Civil Engineering section.  The purpose of that worksheet is to show how to round off values generated by the new logspace function to a specified number of significant figures (SigFigs), which are also known as significant digits.

Since my initial focus for that worksheet was the logspace function, I decided to create a second worksheet that focuses more on the general technique for rounding off to a specified number of SigFigs.  The logspace function only generates positive numbers, so for this worksheet I added a strategically placed absolute value operation to handle negative numbers.  I also rearranged the core function to make it easier to understand.  The other worksheet will be replaced soon with one that incorporates these improvements.

The purpose of this worksheet, then, is to demonstrate the general technique for rounding numbers and elements of vectors and matrices to one or more specific numbers of SigFigs.  Mathcad Prime 3.0 has no way to similarly automate the display of numbers to match the number of significant figures, so that must be handled manually via the Math Formatting tab.

Please note that the SigFig rounding functions in this worksheet do not work with complex numbers.  I haven't used complex numbers since college, so I elected to not provide complex number support.  However, it should be possible to apply this technique separately to the real and imaginary parts, then rebuild the complex number.  I haven't played around with this (and probably won't), but it seems to me that it may require a program to develop a single function that can handle both real and complex numbers.

NOTE:  The attached .zip file contains a Mathcad Prime 3.0 worksheet (.mcdx) and—for those of you who are still using earlier verisions of Mathcad—an Adobe Acrobat printout (.pdf) of the worksheet so can see how it is put together.

1 REPLY 1
MikeArmstrong
5-Regular Member
(To:FredLusk)

Nice work

Top Tags