vpa
Variable-precision arithmetic (arbitrary-precision arithmetic)
Description
Examples
Input Arguments
Output Arguments
Tips
- vpadoes not convert fractions in the exponent to floating point. For example,- vpa(a^sym(2/5))returns- a^(2/5).
- vpauses more digits than the number of digits specified by- digits. These extra digits guard against round-off errors in subsequent calculations and are called guard digits.
- When you call - vpaon a numeric input, such as- 1/3,- 2^(-5), or- sin(pi/4), the numeric expression is evaluated to a double-precision number that contains round-off errors. Then,- vpais called on that double-precision number. For accurate results, convert numeric expressions to symbolic expressions with- sym. For example, to approximate- exp(1), use- vpa(exp(sym(1))).
- If the second argument - dis not an integer,- vparounds it to the nearest integer with- round.
- vparestores precision for numeric inputs that match the forms p/q, pπ/q, (p/q)1/2, 2q, and 10q, where p and q are modest-sized integers.
- Variable-precision arithmetic is different from IEEE® Floating-Point Standard 754 in these ways: - Inside computations, division by zero throws an error. 
- The exponent range is larger than in any predefined IEEE mode. - vpaunderflows below approximately- 10^(-323228496).
- Denormalized numbers are not implemented. 
- Zeros are not signed. 
- The number of binary digits in the mantissa of a result may differ between variable-precision arithmetic and IEEE predefined types. 
- There is only one - NaNrepresentation. No distinction is made between quiet and signaling- NaN.
- No floating-point number exceptions are available.