perl,printf,precision,long-double

bignum will overload all operators in the current scope to use arbitrary precision integers and floating point operations. use bignum; my $f = 123456789.123456789; print "$f\n"; # 123456789.123456789 print $f + $f, "\n"; # 246913578.246913578 Behind the scenes, bignum turns all numeric constants into Math::BigInt and Math::BigNum objects as appropriate....

Possibly via -mlong-double-64 command line switch, but the question is: why do you want to do that? The x86 ABI and x86-64 System V ABI mandate a long double of 96/80 bits respectively¹, i.e. you need to recompile not only your application, but anything it uses which exposes a long...

Use Format method of CString class: CString sNum; long double fNum = 10.0; sNum.Format(_T("%f"), fNum); ...

The C++ way of doing this is pretty simple: #include <sstream> #include <iostream> #include <iomanip> int main() { const std::string line = "502522545.566"; long double num; std::istringstream s(line); s >> num; std::cout << std::fixed << std::setprecision(1) << num << std::endl; } ...

python,numpy,sympy,long-double

IIRC, the precision is actually platform dependent. Anyway, to the question: I think you are looking at the wrong details. >>> print numpy.finfo(numpy.longdouble) Machine parameters for float128 --------------------------------------------------------------------- precision= 18 resolution= 1e-18 machep= -63 eps= 1.08420217249e-19 negep = -64 epsneg= 5.42101086243e-20 minexp=-16382 tiny= 3.36210314311e-4932 maxexp= 16384 max= 1.18973149536e+4932 nexp =...

There's more precision in that number than you're displaying. You just have to ask for it: cout << std::setprecision(40) << pi << endl; That gives me 3.141592653543740176758092275122180581093 when run on Codepad. As double should have way more than enough precision for basic calculations. If you need to compute millions of...

The problem is that by using an expression like ...(1e3000), the Python parser has to calculate what is inside the parentheses first, and pass the result to the function call. Long double is not a native type, therefore, the value inside the parentheses is inf - which is passed to...