Jump to content

Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions

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)
ifdone (1= < i) then.false.
do while (1 < i .andnot. a%bytes(i) == zerodone)
if (i == 1) then
done = .true.
else if (a%bytes(i) /= zero) then
done = .true.
else
i = i - 1
end doif
end ifdo
if (i /= size (a%bytes)) then
allocate (fewer_bytes (i))
1,448

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.