如何定义大于 16 字节的浮点数据类型?

How to define a floating-point data type larger than 16 bytes?

我正在尝试进行需要超过 100 位小数精度的数学计算。 C 数据类型不能超过 16 个字节(long double),所以我不能计算超过 ~17 个小数。有没有办法在 C 中创建一个可以获得更高精度的变量?

实际上,您需要一个任意精度的算术库,请参阅 Wikipedia for some options. I personally have found GNU MPFR to be fairly reliable, though I have also heard good things about Arb