中田真秀(なかたまほ)のブログ

研究について、日常について、その他。

本物の四倍精度 (IEEE 754 2008, binary128) は最近のgfortranで使えます。

2013-10-11 10:46:39 | 日記
on Mac, using macports
$ cat test.f

      implicit none
      real*16 a

      a=1.0Q0/3.0Q0

      print *,a
      end

$ gfortran-mp-4.8 test.f -o test ; ./test
  0.333333333333333333333333333333333317


on FreeBSD 9.1/amd64


$ gfortran47 test.f
$ ./a.out
0.33333333333333333333333333333333332


Ubuntu 12.04.2, gfortran-4.6

$ gfortran-4.6 test.f ; ./a.out
0.33333333333333333333333333333333332

4倍精度、サポートされています。

Windows, mingw

$ gfortran.exe --version ; gfortran.exe test.f ;./a.exe
GNU Fortran (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

0.333333333333333333333333333333333317


ということでgfortranでも多くのプラットフォームでIEEE754 2008のbinary128はサポートされてます。

最新の画像もっと見る

コメントを投稿