GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

[user@openwork fortran]$ cat test.f90 module m_test implicit none integer, parameter :: dp = selected_real_kind(15, 307) contains ! calculate pi using Gregory-Leibniz algorithm ! https://craftofcoding.wordpress.com/2020/04/09/calculating-π-with-gregory-leibniz-ii-fortran/ function pi_leibniz(n) result(x) bind(c, name = 'pi_leibniz') integer, value :: n integer :: i real (kind=dp) :: x x = 1.0_dp do i = 1,n if (mod(i,2) == 1) then x = x - (1.0_dp / ((i*2.0_dp)+1.0_dp)) else x = x + (1.0_dp / ((i*2.0_dp)+1.0_dp)) end if end do x = x * 4.0_dp end function pi_leibniz end module m_test

Download link

https://misskey-taube.s3.wasabisys.com/files/44e0f11e-183a-4b89-a8c1-fd5d1c0f940f.png

Notices where this attachment appears

  1. Embed this notice
    niconiconi (niconiconi@mk.absturztau.be)'s status on Friday, 24-Feb-2023 16:36:00 JST niconiconi niconiconi

    FORTRAN to WebAssembly cross-compile is a success! I can run FORTRAN code in Firefox now!!!

    In conversation 2 years ago from mk.absturztau.be permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.

Embed this notice