Render a real in scientific notation with a canonical exponent field.
Scientific rendering, canonical form [-]D[.DDD]e[+-]NN.
Exactly sig_digits significant digits are produced, one before the
decimal point and the rest after it; sig_digits equal to one yields
no decimal point. The exponent letter is always a lowercase e, the
exponent sign is always present, and the exponent magnitude is written
with a minimum of two digits, zero padded on the left (three digits are
used when the magnitude requires them, as for 1.0e-300). Zero is
rendered with an exponent of zero. sig_digits is clamped to the range
[1, PIC_FORMAT_MAX_SIG_DIGITS].
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Module Procedures
private pure function to_string_sci_sp(value, sig_digits) result(string)
Scientific rendering of a real(sp) value. See to_string_fixed_sp
for why the widening to real(dp) is lossless.
Arguments
Type
Intent
Optional
Attributes
Name
real(kind=sp),
intent(in)
::
value
integer(kind=default_int),
intent(in)
::
sig_digits
Return Value
character(len=:), allocatable
private pure function to_string_sci_dp(value, sig_digits) result(string)