Re: storing an integer in a double precision



In article <4dc3fc3e$0$99954$c30e37c6@xxxxxxxxxxxxxxxxxxxxxx>,
"robin" <robin51@xxxxxxxxxxxxxxxxxx> wrote:

program test
implicit none
integer :: i
do i = huge(i)-5, huge(i)
print *, i
end do
end program test

I can understand why the first code might have problems, the value
of the trip count for the do loop cannot be computed in an integer
register. But I don't see why the above do loop does not terminate.
The trip count should be 6. What quirk of hardware would make it
anything other than 6?

$.02 -Ron Shepard
.



Relevant Pages

  • Re: storing an integer in a double precision
    ... end program test ... of the trip count for the do loop cannot be computed in an integer ... The trip count should be 6. ... The compiler might do an increment and then test instead of computing ...
    (comp.lang.fortran)
  • Re: 24 hour Dirt Rider Test (long)
    ... That sounds like a pretty cool trip. ... In the past the test was on stock bikes to get them tested but this ... Those of us invited could take bikes out and do the loop or just hang ... That was the end of my riding. ...
    (rec.motorcycles.dirt)
  • Re: storing an integer in a double precision
    ... of the trip count for the do loop cannot be computed in an integer ... The trip count should be 6. ... The compiler might do an increment and then test instead of computing ... end subroutine bar ...
    (comp.lang.fortran)
  • Re: Cant figure this code
    ... Each additional trip through the loop adds a new Token to ... leaving you with both m_head and m_tail pointing at what I'll ... Token2 has been lost, and there is no way to find it any more. ...
    (comp.lang.c)
  • Re: "Green Light Trigger"
    ... the loop was buried under the pavement. ... it'll trip even faster. ... http://spoiled-brat.com/rwr (m/c related site) ...
    (rec.motorcycles.harley)