MeridianMERIDIAN

Scientific Notation

representation.numeric.scientific_notation

Number in scientific notation (e.g., 1.23e-4, 5E+6, 3.14e10). Transforms to DOUBLE.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs DOUBLEexponentmantissa
1.23e-40.000123-41.23
5E+65000000.065.0
3.14e1031400000000.0103.14
-2.5e-3-0.0025-3-2.5

Shape

Pattern
^-?[0-9]+(\.[0-9]+)?[eE][+-]?[0-9]+$
ValueLengthShape
1.23e-47matches
5E+64matches
3.14e107matches
-2.5e-37matches
1.23e-6rejected: one character short

Told apart

1 of the 5 other numeric types accept every one of these samples on shape alone.

Going the other way, this type's own rule accepts 2 of 6 samples of Decimal Number.

Background

Origin

In E notation, the letter E or e stands for exponent and is read as times ten raised to the power of.[1] E notation comes from Fortran and was present in the first version of Fortran, released for the IBM 704 in 1956.[1] The developers of the SHARE Operating System for the IBM 709 were already using E notation in 1958.[1] ALGOL 60 took a different route, writing a subscript ten character in place of the letter E.[1] The first pocket calculators to support scientific notation appeared in 1972.[1]

In normalised scientific notation, called standard form in the United Kingdom, the exponent is chosen so that the absolute value of the leading number is at least one and less than ten.[1] Engineering notation differs from normalised scientific notation by restricting the exponent to multiples of 3.[1]

Use

JSON's number grammar in RFC 8259 includes an exponent part that begins with the letter E in uppercase or lowercase, optionally followed by a plus or minus sign.[2] Python's float() accepts an exponent written as e or E, with an optional sign, after leading and trailing whitespace is removed.[3] DuckDB's documentation says non-integer numeric literals can be written in E notation, giving 1e2 as 100 and 6.02214e23 as Avogadro's constant.[4]

Microsoft Excel's General format uses exponential notation for large numbers of 12 or more digits.[5] Microsoft's example shows a 2-decimal scientific format displaying 12345678901 as 1.23E+10.[5] Excel's maximum limit for number precision is 15 digits.[5] When a column of long identifiers, such as account or barcode numbers, arrives as values like 1.23E+10, treat it as a sign that a spreadsheet touched the file and go back to the original export rather than casting it. (Meridian's view)

IEEE 754 double precision gives from 15 to 17 significant decimal digits of precision.[6] RFC 8259 notes that a JSON number such as 1E400 may indicate potential interoperability problems.[2]

Detection notes

v1 migration: New for v2. Covers scientific notation like 1.23e-4. Decompose extracts mantissa and exponent.

Use it

CLI · DuckDB
$ finetype infer -i "1.23e-4" --mode column
→ representation.numeric.scientific_notation

SELECT ft_infer('1.23e-4');
-- → 'representation.numeric.scientific_notation'
Cast expression
CAST({col} AS DOUBLE)

Schema

https://meridian.online/schemas/representation.numeric.scientific_notation · Frictionless type number

finetype taxonomy representation.numeric.scientific_notation -o json-schema

Aliases

scientificexponential

Type Registry