Function c = real2str(c)
returns the input record after inclusion of
string representations of real r.
The input argument c contains a record with at
least the following fields:
"val": contains the value of r;
"mts": contains the mantissa of r as a string,
which consists of the sign followed by
the significant digits;
"pot": contains the magnitude (of the first
significant digit) of r as an integer,
i.e. the m-th power-of-ten of r;
"nsd": contains the number of significant digits
of r as an integer. This number is always
>= 1 and <= p;
"k": contains the k-th power-of-ten to be
displayed in the string representation.
The string representation contains:
-- a sign (only when r is negative),
-- a fractional part (with a decimal dot), and:
-- the k-th power of ten.
The result can be expressed with the following
pattern:
[-]d[.d+][e[-]d+]
where "d" indicates a single digit, brackets a
possible expansion, "+" one or more times the
type of the previous token, "-" the minus sign,
and "." the decimal dot, and "e" the letter e
after which the integer k is printed.
The output record has the following additional
fields:
"ascii": the representation in plain ascii;
"ascii_left": the left side of the representation in ascii;
"ascii_right": the right side of the representation in ascii;
"html": the representation in html;
"html_left": the left side of the representation in html;
"html_right": the right side of the representation in html.
A real may have a non-finite value, it will be
displayed as "NA", "NaN", "Inf" or "-Inf".
(c) 2026 fabien van mook
2026.08.20 release of this file within package "fvm-real2eng" under GNU GPLv3+