Mathcad: Floating Point Calculations in Symbolics

You may think of using symbolics for problems involving undefined variables (Ref Fig. 1):

While this is a very useful feature, it is also important to note that symbolics can be used to solve problems, which can be calculated numerically.

Whenever something is calculated numerically in Mathcad, the result is stored to 17 digits of precision (Ref Fig. 2).

Click on a result and choose Format > Result to see more decimal places.

The symbolic processor manipulates expressions algebraically to produce exact answers (Ref Fig. 3).

However, if you enter a decimal value in your expression, Mathcad automatically returns a floating-point result. This is true for both menu symbolics and live symbolics.

Menu-driven Symbolics

Both expressions below are evaluated using the Evaluate > Symbolically option on the Symbolics menu (Ref Fig. 4).

Live symbolics

Both menu-driven and live symbolics also offer options for returning a result in terms of a floating point number, even when you enter your calculations using exact values (Ref Fig. 5).

The Floating Point Menu Option

To evaluate an expression with floating point precision using menu-driven symbolics, select your expression (Ref Fig. 6):

Choose Evaluate > Floating Point... from the Symbolics menu (Ref Fig. 7).

A dialog appears asking how many decimals of precision to use (Ref Fig. 8).

Mathcad displays a result using the specified precision (Ref Fig. 9).

floating point evaluation yields (Ref Fig. 10).

Note that the placement of the result with respect to the original expression, as well as the appearance of comments, is determined by the settings on the Evaluation Style dialog found on the Symbolics menu.

The menu-driven option allows you to return up to 4000 decimals of precision. However, Mathcad is not able to display such large results and returns an error message.

The float Keyword

Live Symbolic results are controlled using keywords. The float keyword is the live symbolic equivalent of the Floating Point menu option.

Solve the equation for x using the live symbolic keyword solve, and Mathcad returns three exact roots (Ref Fig. 11).

The display of such results can be unwieldy. If all you need is a floating point approximation, the float keyword can be used to specify the desired precision of the result. Press [Ctrl][Shift][.] to add multiple keywords (Ref Fig. 12).

The default precision for float is 20. An optional integer argument ranging from 1 to 250 can be used to control the result (Ref Fig. 13, 14 and 15).

An important note: float cannot be used to extend precision on floating point calculations using live symbolics.

When you request a live symbolic evaluation (regardless of the modifiers), Mathcad first symbolicly evaluates the expression before applying any keyword modifiers. The evaluation is automatically converted to floating point with the default precision (20) if there are any decimal points in the expression (Ref Fig. 16).

If the expression contains a floating-point number, which is used as the argument to a function, this forces a floating-point evaluation with the default precision. Since the result has already been calculated using only 20 digits of precision, more than 20 digits of precision cannot be returned regardless of the number specified by the keyword (Ref Fig. 17).

Learn more with other tutorials...

Electronic Curriculum Unit Development with Mathcad Prime and Microsoft OneNote
Matrices in Algebra 1: Mathcad 15.0 Illustrates the Solutions Clearly
  • Matrices in Algebra 1: Mathcad 15.0 Illustrates the Solutions Clearly

  • |
  • |
  • Intermediate Level
  • |
  • Matrices are challenging, but they are really important in applied mathematics – they are a critical STEM topic. Engineers and scientists use matrices to solve challenging problems in many, many dimensions. ... (Show more)
Creating Better Homework Papers with Mathcad
Is eLearning right for me? Download Checklist

Free Checklist – Is eLearning right for me?

This new article offers guidance on finding the right eLearning solution for you and your organization. Learn about the advantages of eLearning and how to avoid pitfalls. On top, receive a free checklist to help you evaluate a solution.
Download now!   
Replay video? Resume video