to_string_sci Interface

public interface to_string_sci

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].

Calls

interface~~to_string_sci~~CallsGraph interface~to_string_sci to_string_sci proc~to_string_sci_dp to_string_sci_dp interface~to_string_sci->proc~to_string_sci_dp proc~to_string_sci_sp to_string_sci_sp interface~to_string_sci->proc~to_string_sci_sp proc~expand_exact expand_exact proc~to_string_sci_dp->proc~expand_exact proc~exponent_field exponent_field proc~to_string_sci_dp->proc~exponent_field proc~is_negative is_negative proc~to_string_sci_dp->proc~is_negative proc~round_decimal round_decimal proc~to_string_sci_dp->proc~round_decimal proc~special_text special_text proc~to_string_sci_dp->proc~special_text proc~to_string_sci_sp->proc~to_string_sci_dp proc~bd_mul_pow bd_mul_pow proc~expand_exact->proc~bd_mul_pow proc~bd_set bd_set proc~expand_exact->proc~bd_set proc~bd_to_digits bd_to_digits proc~expand_exact->proc~bd_to_digits interface~to_string to_string proc~exponent_field->interface~to_string proc~increment_digits increment_digits proc~round_decimal->proc~increment_digits proc~bd_mul_small bd_mul_small proc~bd_mul_pow->proc~bd_mul_small proc~limb_to_digits limb_to_digits proc~bd_to_digits->proc~limb_to_digits

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 IntentOptional 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)

Scientific rendering of a real(dp) value.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: value
integer(kind=default_int), intent(in) :: sig_digits

Return Value character(len=:), allocatable