Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) (view source)
Revision as of 02:42, 16 March 2023
, 1 year ago→{{header|Fortran}}
Line 2,632:
{{trans|ObjectIcon}}
This program includes a primitive module for multiple-precision integer arithmetic. It is adequate for the task.
<syntaxhighlight lang="fortran">
Line 3,524:
type(big_integer), intent(inout) :: a
logical :: done
integer :: i
character, allocatable :: fewer_bytes(:)
Line 3,529 ⟶ 3,530:
! Shorten to the minimum number of bytes.
i = size (a%bytes)
if (i == 1) then
done = .true.
else if (a%bytes(i) /= zero) then
done = .true.
else
i = i - 1
end
end
if (i /= size (a%bytes)) then
allocate (fewer_bytes (i))
|