Package: pyquadp
pyQuadpPython interface to gcc's libquadmath for quad (128-bit) precision maths.Buildpython-mbuild
python-mpipinstall.Package is not yet available on pypi.This package requiresquadmath.handlibquadmath.so. This might come installed with your installation of gcc/gfortran from your package manager. Or it might require a separate installation. This should be installed before trying to install the Python package.Fedorasudodnfinstalllibquadmathlibquadmath-develUsageqfloatA quad precision number is created by passing either a int, float, or string toqfloat:importpyquadpq=pyquadp.qfloat(1)q=pyquadp.qfloat(1.0)q=pyquadp.qfloat('1')Aqfloatimplements Python's NumberProtocol, thus it can be used like any other number, either with basic math operations or in rich comparisons:q1=pyquadp.qfloat(1)q2=pyquadp.qfloat(2)q1+q2# pyquadp.qfloat(3)q1*q2# pyquadp.qfloat(2)q1+=q2# pyquadp.qfloat(3)q1<=q2# Trueq1==q2# Falsestr(q)# "1.000000000000000000000000000000000000e+00"qcmplxA quad precision number is created by passing either a complex variable or two ints, floats, strs, or qfloats toqcmplx:importpyquadpq=pyquadp.qcmplx(complex(1,1))q=pyquadp.qcmplx(1,1.0)q=pyquadp.qcmplx('1',1.0)q=pyquadp.qcmplx('1','1')q=pyquadp.qcmplx(pyquadp.qfloat(1),pyquadp.qfloat('1'))Note that strings must be split into two components. There is no support for1+1j(unless passed via complex('1+1j'))Math librariesTheqmathprovides the union of math operations from Python'smathlibrary and the routines provided inlibquadmath.qmathprovides routines forqfloat, while complex numbers are handled byqcmathversions.Where possible functions accessed via the Python name follows Python's conventions
regarding behavior of exceptional values. While routines fromlibquadmath(those ending inq) followslibquadmath's conventions.Routines from Python'smathlibraryNameImplementedDescritpionceil:heavy_check_mark:comb:x:copysign:heavy_check_mark:fabs:heavy_check_mark:factorial:x:floor:heavy_check_mark:fmod:heavy_check_mark:frexp:heavy_check_mark:fsum:x:gcd:x:isclose:x:isfinite:x:isinf:heavy_check_mark:isnan:heavy_check_mark:isqrt:x:lcm:x:ldexp:heavy_check_mark:modf:heavy_check_mark:nextafter:heavy_check_mark:perm:x:prod:x:remainder:heavy_check_mark:trunc:heavy_check_mark:ulp:x:cbrt:heavy_check_mark:exp:heavy_check_mark:exp2:heavy_check_mark:expm1:heavy_check_mark:log:heavy_check_mark:log1p:heavy_check_mark:log2:heavy_check_mark:log10:heavy_check_mark:pow:heavy_check_mark:sqrt:heavy_check_mark:acos:heavy_check_mark:asin:heavy_check_mark:atan:heavy_check_mark:atan2:heavy_check_mark:cos:heavy_check_mark:dist:x:hypot:heavy_check_mark:sin:heavy_check_mark:tan:heavy_check_mark:degress:x:radians:x:acosh:heavy_check_mark:asinh:heavy_check_mark:atanh:heavy_check_mark:cosh:heavy_check_mark:sinh:heavy_check_mark:tanh:heavy_check_mark:erf:heavy_check_mark:erfc:heavy_check_mark:gamma:heavy_check_mark:lgamma:heavy_check_mark:pi:heavy_check_mark:e:heavy_check_mark:tau:heavy_check_mark:inf:heavy_check_mark:nan:heavy_check_mark:Routines from gcc'slibquadthmathlibraryNameImplementedacosq:heavy_check_mark:acoshq:heavy_check_mark:asinq:heavy_check_mark:asinhq:heavy_check_mark:atanq:heavy_check_mark:atanhq:heavy_check_mark:atan2q:heavy_check_mark:cbrtq:heavy_check_mark:ceilq:heavy_check_mark:copysignq:heavy_check_mark:coshq:heavy_check_mark:cosq:heavy_check_mark:erfq:heavy_check_mark:erfcq:heavy_check_mark:exp2q:heavy_check_mark:expq:heavy_check_mark:expm1q:heavy_check_mark:fabsq:heavy_check_mark:fdimq:heavy_check_mark:finiteq:heavy_check_mark:floorq:heavy_check_mark:fmaq:heavy_check_mark:fmaxq:heavy_check_mark:fminq:heavy_check_mark:fmodq:heavy_check_mark:frexpq:heavy_check_mark:hypotq:heavy_check_mark:ilogbq:heavy_check_mark:isinfq:heavy_check_mark:isnanq:heavy_check_mark:issignalingq:heavy_check_mark:j0q:heavy_check_mark:j1q:heavy_check_mark:jnq:heavy_check_mark:ldexpq:heavy_check_mark:lgammaq:heavy_check_mark:llrintq:heavy_check_mark:llroundq:heavy_check_mark:logbq:heavy_check_mark:logq:heavy_check_mark:log10q:heavy_check_mark:log1pq:heavy_check_mark:log2q:heavy_check_mark:lrintq:heavy_check_mark:lroundq:heavy_check_mark:modfq:heavy_check_mark:nanq:heavy_check_mark:nearbyintq:heavy_check_mark:nextafterq::heavy_check_mark:powq:heavy_check_mark:remainderq:heavy_check_mark:remquoq:heavy_check_mark:rintq:heavy_check_mark:roundq:heavy_check_mark:scalblnq:heavy_check_mark:scalbnq:heavy_check_mark:signbitq:heavy_check_mark:sincosq:heavy_check_mark:sinhq:heavy_check_mark:sinq:heavy_check_mark:sqrtq:heavy_check_mark:tanq:heavy_check_mark:tanhq:heavy_check_mark:tgammaq:heavy_check_mark:truncq:heavy_check_mark:y0q:heavy_check_mark:y1q:heavy_check_mark:ynq:heavy_check_mark:Routines from Python's complex mathcmathlibraryThese are available fromqcmathNameImplementedDescritpionphase:heavy_check_mark:polar:heavy_check_mark:rect:heavy_check_mark:exp:heavy_check_mark:log:heavy_check_mark:log10:heavy_check_mark:sqrt:heavy_check_mark:acos:heavy_check_mark:asin:heavy_check_mark:atan:heavy_check_mark:cos:heavy_check_mark:sin:heavy_check_mark:tan:heavy_check_mark:acosh:heavy_check_mark:asinh:heavy_check_mark:atanh:heavy_check_mark:cosh:heavy_check_mark:sinh:heavy_check_mark:tanh:heavy_check_mark:isfinite:heavy_check_mark:isinf:heavy_check_mark:isnan:heavy_check_mark:isclose:x:pi:heavy_check_mark:e:heavy_check_mark:tau:heavy_check_mark:inf:heavy_check_mark:infj:heavy_check_mark:nan:heavy_check_mark:nanj:heavy_check_mark:Routines from complex mathlibquadthmathlibraryThese are available fromqcmathNameImplementedDescritpioncabsq:heavy_check_mark:complex absolute value functioncargq:heavy_check_mark:calculate the argumentcimagq:heavy_check_mark:imaginary part of complex numbercrealq:heavy_check_mark:real part of complex numbercacoshq:heavy_check_mark:complex arc hyperbolic cosine functioncacosq:heavy_check_mark:complex arc cosine functioncasinhq:heavy_check_mark:complex arc hyperbolic sine functioncasinq:heavy_check_mark:complex arc sine functioncatanhq:heavy_check_mark:complex arc hyperbolic tangent functioncatanq:heavy_check_mark:complex arc tangent functionccosq::heavy_check_mark:complex cosine functionccoshq:heavy_check_mark:complex hyperbolic cosine functioncexpq:heavy_check_mark:complex exponential functioncexpiq:heavy_check_mark:computes the exponential function ofitimes a real valueclogq:heavy_check_mark:complex natural logarithmclog10q:heavy_check_mark:complex base 10 logarithmconjq:heavy_check_mark:complex conjugate functioncpowq:heavy_check_mark:complex power functioncprojq:heavy_check_mark:project into Riemann Spherecsinq:heavy_check_mark:complex sine functioncsinhq:heavy_check_mark:complex hyperbolic sine functioncsqrtq:heavy_check_mark:complex square rootctanq:heavy_check_mark:complex tangent functionctanhq:heavy_check_mark:complex hyperbolic tangent functionConstants fromlibquadthmathlibrary.The following constants are availbe both inqmathandqcmathNameImplementedDescritpionFLT128_MAX:heavy_check_mark:largest finite numberFLT128_MIN:heavy_check_mark:smallest positive number with full precisionFLT128_EPSILON:heavy_check_mark:difference between 1 and the next larger representable numberFLT128_DENORM_MIN:heavy_check_mark:smallest positive denormalized numberFLT128_MANT_DIG:heavy_check_mark:number of digits in the mantissa (bit precision)FLT128_MIN_EXP:heavy_check_mark:maximal negative exponentFLT128_MAX_EXP:heavy_check_mark:maximal positive exponentFLT128_DIG:heavy_check_mark:number of decimal digits in the mantissaFLT128_MIN_10_EXP:heavy_check_mark:maximal negative decimal exponentFLT128_MAX_10_EXP:heavy_check_mark:maximal positive decimal exponentM_Eq:heavy_check_mark:the constant e (Euler’s number)M_LOG2Eq:heavy_check_mark:binary logarithm of 2M_LOG10Eq:heavy_check_mark:common, decimal logarithm of 2M_LN2q:heavy_check_mark:natural logarithm of 2M_LN10q:heavy_check_mark:natural logarithm of 10M_PIq:heavy_check_mark:piM_PI_2q:heavy_check_mark:pi divided by twoM_PI_4q:heavy_check_mark:pi divided by fourM_1_PIq:heavy_check_mark:one over piM_2_PIq:heavy_check_mark:one over two piM_2_SQRTPIq:heavy_check_mark:two over square root of piM_SQRT2q:heavy_check_mark:square root of 2M_SQRT1_2q:heavy_check_mark:one over square root of 2