bd_set Subroutine

private pure subroutine bd_set(limb, n_limb, value)

Initialise the big integer from a strictly positive int64.

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(out) :: limb(:)
integer(kind=default_int), intent(out) :: n_limb
integer(kind=int64), intent(in) :: value

Called by

proc~~bd_set~~CalledByGraph proc~bd_set bd_set proc~expand_exact expand_exact proc~expand_exact->proc~bd_set proc~to_string_fixed_dp to_string_fixed_dp proc~to_string_fixed_dp->proc~expand_exact proc~to_string_sci_dp to_string_sci_dp proc~to_string_sci_dp->proc~expand_exact interface~to_string_fixed to_string_fixed interface~to_string_fixed->proc~to_string_fixed_dp proc~to_string_fixed_sp to_string_fixed_sp interface~to_string_fixed->proc~to_string_fixed_sp 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_fixed_sp->proc~to_string_fixed_dp proc~to_string_sci_sp->proc~to_string_sci_dp

Variables

Type Visibility Attributes Name Initial
integer(kind=int64), private :: remaining

Source Code

   pure subroutine bd_set(limb, n_limb, value)
      !! Initialise the big integer from a strictly positive `int64`.
      integer(int64), intent(out) :: limb(:)
      integer(default_int), intent(out) :: n_limb
      integer(int64), intent(in) :: value
      integer(int64) :: remaining

      limb = 0_int64
      remaining = value
      n_limb = 0_default_int
      do while (remaining > 0_int64)
         n_limb = n_limb + 1_default_int
         limb(n_limb) = mod(remaining, LIMB_BASE)
         remaining = remaining/LIMB_BASE
      end do

   end subroutine bd_set