Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

x86-64 long double precision

What is the actual precision of long double on Intel 64-bit platforms? is it 80 bits padded to 128 or actual 128 bit?

if former, besides going gmp, is there another option to achieve true 128 precision?

like image 784
Anycorn Avatar asked May 10 '10 00:05

Anycorn


2 Answers

x86-64 precision is the same as regular x86. Extended double is 80 bits, using the x87 ISA, with 6 padding bytes added. There is no 128-bit FP hardware.

A software implementation of quad or extended quad precision might benefit from the x86-64 64x64 => 128 integer multiply instruction, though.

like image 121
Potatoswatter Avatar answered Sep 21 '22 02:09

Potatoswatter


I would recommend using MPFR. It is a more sophisticated multiple-precision floating point library that is built on top of GMP.

like image 34
casevh Avatar answered Sep 18 '22 02:09

casevh