Products & Services Industries Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

digits - Variable precision accuracy

Syntax

digits
digits(d)
d = digits

Description

digits specifies the number of significant decimal digits that MuPAD software uses to do variable precision arithmetic (VPA). The default value is 32 digits.

digits(d) sets the current VPA accuracy to d digits.

d = digits returns the current VPA accuracy.

Examples

If

z = 1.0e-16
x = 1.0e+2
digits(14)

then

y = vpa(x*z+1)

uses 14-digit decimal arithmetic and returns

y =
1.0

Whereas

digits(15)
y = vpa(x*z+1)

used 15-digit decimal arithmetic and returns

y =
1.00000000000001

See Also

double, vpa

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS