quadruple-precision

Quadruple precision in G++ 4.6.3 Linux using quadmath

两盒软妹~` 提交于 2019-12-19 06:57:42
问题 I try to execute the code #include <quadmath.h> #include <iostream> int main() { char* y = new char[1000]; quadmath_snprintf(y, 1000, "%Qf", 1.0q); std::cout << y << std::endl; return 0; } with commands g++ test.cpp -o test I get the error: /tmp/cctqto7E.o: In function `main': test.cpp:(.text+0x51): undefined reference to `quadmath_snprintf(char*, unsigned int, char const*, ...)' collect2: ld returned 1 exit status The version is: g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Quadruple Precision in C++ (GCC)

半腔热情 提交于 2019-12-17 15:57:17
问题 Just recently, the GCC 4.6.0 came out along with libquadmath. Unfortunately, GNU has supported Fortran, but not C or C++ (all that is included is a .so). I have not found a way to use these new features in C++, however, GNU C does support the __float128 type for guaranteed quadruple-precision floats. GNU C does not seem to support the math functions in libquadmath, such fabsq (absolute value, q being the suffix for quad). Is there any way to get these functions working in C++, or is there

Strange result of MPI_AllReduce for 16 byte real

懵懂的女人 提交于 2019-12-10 12:59:29
问题 Compiler: gfortran-4.8.5 MPI library: OpenMPI-1.7.2 (preinstalled OpenSuSE 13.2) This program: use mpi implicit none real*16 :: x integer :: ierr, irank, type16 call MPI_Init(ierr) call MPI_Comm_Rank(MPI_Comm_World, irank, ierr) if (irank+1==1) x = 2.1 if (irank+1==8) x = 2.8 if (irank+1==7) x = 5.2 if (irank+1==4) x = 6.7 if (irank+1==6) x = 6.5 if (irank+1==3) x = 5.7 if (irank+1==2) x = 4.0 if (irank+1==5) x = 6.8 print '(a,i0,a,f3.1)', "rank+1: ",irank+1," x: ",x call MPI_AllReduce(MPI_IN

quadmath and argument type for scanf

帅比萌擦擦* 提交于 2019-12-10 10:46:33
问题 I use the <quadmath.h> . With which argument type can I read my input correctly? If I use double it looks like: printf("enter 3 values for s, t and mt:\n"); scanf("%lf %lf %lf", &s, &t, &mt); printf("%lf %lf %lf\n", s, t, mt); I tried different possibilities instead of "l" for example: scanf("%Qf %Qf %Qf", &s, &t, &mt); or even without scanf("%f %f %f", &s, &t, &mt); however I get an error. 回答1: scanf (and related functions and printf and related functions) is not extensible . It can only

quadmath and argument type for scanf

删除回忆录丶 提交于 2019-12-06 08:09:50
I use the <quadmath.h> . With which argument type can I read my input correctly? If I use double it looks like: printf("enter 3 values for s, t and mt:\n"); scanf("%lf %lf %lf", &s, &t, &mt); printf("%lf %lf %lf\n", s, t, mt); I tried different possibilities instead of "l" for example: scanf("%Qf %Qf %Qf", &s, &t, &mt); or even without scanf("%f %f %f", &s, &t, &mt); however I get an error. scanf (and related functions and printf and related functions) is not extensible . It can only parse what the standard library knows about. The C standard library comes with the operating system, not the

Quadruple precision in G++ 4.6.3 Linux using quadmath

懵懂的女人 提交于 2019-12-01 04:58:45
I try to execute the code #include <quadmath.h> #include <iostream> int main() { char* y = new char[1000]; quadmath_snprintf(y, 1000, "%Qf", 1.0q); std::cout << y << std::endl; return 0; } with commands g++ test.cpp -o test I get the error: /tmp/cctqto7E.o: In function `main': test.cpp:(.text+0x51): undefined reference to `quadmath_snprintf(char*, unsigned int, char const*, ...)' collect2: ld returned 1 exit status The version is: g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions

Quadruple Precision in C++ (GCC)

♀尐吖头ヾ 提交于 2019-11-27 20:46:30
Just recently, the GCC 4.6.0 came out along with libquadmath . Unfortunately, GNU has supported Fortran, but not C or C++ (all that is included is a .so). I have not found a way to use these new features in C++, however, GNU C does support the __float128 type for guaranteed quadruple-precision floats. GNU C does not seem to support the math functions in libquadmath , such fabsq (absolute value, q being the suffix for quad). Is there any way to get these functions working in C++, or is there some alternative library that I could use for math functions with __float128 ? What is the best method