exponent_field Function

private pure function exponent_field(exp10) result(string)

Canonical exponent field: sign, then at least two zero padded digits.

Arguments

Type IntentOptional Attributes Name
integer(kind=default_int), intent(in) :: exp10

Return Value character(len=:), allocatable


Calls

proc~~exponent_field~~CallsGraph proc~exponent_field exponent_field interface~to_string to_string proc~exponent_field->interface~to_string

Called by

proc~~exponent_field~~CalledByGraph proc~exponent_field exponent_field proc~to_string_sci_dp to_string_sci_dp proc~to_string_sci_dp->proc~exponent_field interface~to_string_sci to_string_sci 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~to_string_sci_sp->proc~to_string_sci_dp

Variables

Type Visibility Attributes Name Initial
character(len=:), private, allocatable :: magnitude

Source Code

   pure function exponent_field(exp10) result(string)
      !! Canonical exponent field: sign, then at least two zero padded digits.
      integer(default_int), intent(in) :: exp10
      character(len=:), allocatable :: string
      character(len=:), allocatable :: magnitude

      magnitude = to_string(abs(exp10))
      if (len(magnitude) < 2) magnitude = "0"//magnitude
      if (exp10 < 0_default_int) then
         string = "-"//magnitude
      else
         string = "+"//magnitude
      end if

   end function exponent_field