Search code examples
fortranquadruple-precision

Taking square root to quadruple precision


How can I do a square root for Real(Real128)?


Solution

  • You just use the generic function sqrt and it will call the correct specific function, qsqrt (Not sure if that's a standard name. Both ifort and gfortran call it that). However, your compiler may not implement it yet. I know ifort does, but gfortran does not. And that applies to other intrinsic functions such as trig functions as well.

    Also, quad precision operations are usually performed in software, so it's much slower.