[心得] (x + 1) > x, 那可 不一定

看板Fortran作者 (sjgau)時間15年前 (2008/09/08 20:36), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
real 的變數宣告,default is 4- bytes real, 有效位數,精確度 只有 6 - 7位 所以,。。。 !dec$if (.false.) 1.6976348E+07 1.6976348E+07 Press any key to continue !dec$endif ! ----------------------------------------------- program CF0610 implicit none real x, y x= 4.0*atan(1.0) y= x + 1.0 ! y > x do while (y .GT. x) x= x*1.0001 y= x + 1.0 end do ! y <= x write(*, *)x, y end program CF0610 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.231.16.169
文章代碼(AID): #18nHngje (Fortran)
文章代碼(AID): #18nHngje (Fortran)