@hackage significant-figures0.1.0.0

Calculate expressions involving significant figures.

This library provides a module Data.SigFig that helps with the parsing and evaluation of expressions involving significant figures. Significant figures are a method, often used in chemistry, of assessing and controlling the precision/uncertainty from measured values in calculations.

Expressions with significant figures are not easily calculable with a normal calculator, since they require intermediate rounding based on the rules governing significant figures. This library takes care of not only the intermediate rounding during evaluation, but also provides functions to parse text into expressions.

Parsing supports integer, float, and scientific notation (via E notation), constant terms (terms with effectively infinite significant figures), common operations, parentheses, and an additional small set of functions. Expressions can also be constructed via helper functions.

Evaluation takes care of rounding when dealing with expressions involving either/both of constant and measured terms. A few functions, however, such as log(), are unsupported on constant arguments, since with the current implementation it is impractical to store such a value that has theoretical infinite significant figures.