to_string_fixed_sp Function

private pure function to_string_fixed_sp(value, decimals) result(string)

Fixed point rendering of a real(sp) value.

Widening to real(dp) is exact for every finite real(sp) value and preserves NaN and both infinities, so the double precision expansion produces the same digits.

Arguments

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

Return Value character(len=:), allocatable


Calls

proc~~to_string_fixed_sp~~CallsGraph proc~to_string_fixed_sp to_string_fixed_sp proc~to_string_fixed_dp to_string_fixed_dp proc~to_string_fixed_sp->proc~to_string_fixed_dp proc~assemble_fixed assemble_fixed proc~to_string_fixed_dp->proc~assemble_fixed proc~expand_exact expand_exact proc~to_string_fixed_dp->proc~expand_exact proc~is_negative is_negative proc~to_string_fixed_dp->proc~is_negative proc~round_decimal round_decimal proc~to_string_fixed_dp->proc~round_decimal proc~special_text special_text proc~to_string_fixed_dp->proc~special_text 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 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

Called by

proc~~to_string_fixed_sp~~CalledByGraph proc~to_string_fixed_sp to_string_fixed_sp interface~to_string_fixed to_string_fixed interface~to_string_fixed->proc~to_string_fixed_sp

Source Code

   pure function to_string_fixed_sp(value, decimals) result(string)
      !! Fixed point rendering of a `real(sp)` value.
      !!
      !! Widening to `real(dp)` is exact for every finite `real(sp)` value and
      !! preserves NaN and both infinities, so the double precision expansion
      !! produces the same digits.
      real(sp), intent(in) :: value
      integer(default_int), intent(in) :: decimals
      character(len=:), allocatable :: string

      string = to_string_fixed_dp(real(value, dp), decimals)

   end function to_string_fixed_sp