Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The coprocessor uses 80-bit floats, that’s more than double precision. It even has a special instruction, fldpi, to get π in the full precision: https://www.felixcloutier.com/x86/fld1:fldl2t:fldl2e:fldpi:f...


It does however completely bollocks up all the subsequent trigonometry functions. Even intel says not to use them.

Also alas, 80bit is a bit of a misnomer - when comparing to the more regular ieee754 representations, it’s actually fp79 :D


Intel's Manual says to use FLDPI. The x87 FPU represents pi internally at extended-extended-precision, so it's more like fp82 :D Were you thinking about the argument reduction gotcha? http://galaxy.agh.edu.pl/~amrozek/AK/x87.pdf


Fldpi only loads the register, rounding according to the current rounding mode, so you still only have 63 bits of precision when you load the value.

For intermediate calculations it incorporates the internal extended pi via the GRS bits.

And yeah the train wreck of argument reduction was my reference




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: