scientific
Formats numeric values in scientific notation while preserving the expression's mathematical value.
scientific(value[, significantDigits]) records a scientific-notation presentation with an optional significant-digit count. The value remains exact for subsequent symbolic work.
The significant-digit count must be an integer from 1 through 1e9 and defaults to 10.
Examples
These examples use Nerdamer Notation.
Round a positive integer to three significant digits in scientific notation.
scientific(12345,3)
// → 1.23e4Preserve trailing zeros required by the requested precision.
scientific(1200,4)
// → 1.200e3Format an exact rational value with four significant digits.
scientific(1/8,4)
// → 1.250e-1Format and round a negative value.
scientific(-987654,4)
// → -9.877e5Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
scientific(value[, significantDigits])
Parameters
value— Expression whose numeric values should use scientific notation.significantDigits— Optional integer from 1 through 1e9. The coefficient retains exactly this many significant digits. Defaults to 10.
nerdamer.scientific
Call the operation through the default nerdamer import.
nerdamer.scientific(x: ExpressionInput, significantDigits: ExpressionInput): Expression
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | — |
significantDigits | ExpressionInput | — |
