Skip to content

Precision ​

How many significant decimal digits a number carries.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguagePrecision!
Precision(expr)PositiveInfinityPositiveInfinity for an exact number, MachinePrecision for a machine number, otherwise its significant decimal digit count.
Typed signatures
TypePackageApplies
(any) -> integer<1..> | real | signed_infinitycombinatoricsalways

Domain: Collections

Details
  • Exact numbers (integers, rationals, radicals, symbolic constants like π\pi) carry infinite precision, Wolfram's own convention.
  • A literal of up to 17 digits (what a double holds) is a machine number: its precision is the symbol MachinePrecision, as in Wolfram.
  • A literal with more digits counts the digits actually written; Wolfram's count is not an integer (20.497 for 21 digits).

Examples

2 more kept as data, checked against the oracles
Basic #
live ↗
InPrecision(2)\mathrm{Precision}(2)Out∞∞

Exact numbers carry infinite precision

live ↗
InPrecision(65)\mathrm{Precision}(\frac{6}{5})Out∞∞
Scope #

An exact rational also carries infinite precision

live ↗
InPrecision(13)\mathrm{Precision}(\frac{1}{3})Out∞∞

A machine number's precision is the symbol MachinePrecision

live ↗
InPrecision(2.5)\mathrm{Precision}(2.5)OutMachinePrecision\mathrm{MachinePrecision}

A double's sixteen digits are still a machine number

live ↗
InPrecision(3.141 592 653 589 793)\mathrm{Precision}(3.141\,592\,653\,589\,793)OutMachinePrecision\mathrm{MachinePrecision}

Symbolic expressions with exact coefficients also report infinite precision

live ↗
InPrecision(5x2+3)\mathrm{Precision}(5x^2+3)Out∞∞
About
Examples8
Checked againstWolfram Language 7 agree1 differ
CrosswalkWolfram Language

See also: IsMachineNumber, IsNumeric