advanpix / mpreal

GNU General Public License v3.0
84 stars 19 forks source link

Add support for __float128 conversions #6

Open benruijl opened 3 years ago

benruijl commented 3 years ago

Starting from MPR 4.0, the functions mpfr_set_float128 and mpfr_get_float128 can be used to convert from and to __f128 (see test cases here for usage: https://fossies.org/linux/misc/mpfr-4.1.0.tar.gz/mpfr-4.1.0/tests/tset_float128.c).

It would be great if mpreal supports these conversions as well.

benruijl commented 3 years ago

In my forked version https://github.com/benruijl/mpreal/commit/9cf67d12ec23a8e8ce117cb9194dac57b3dcd674 I've added support for __float128 by essentially copying all long double functions. These functions may all need to be wrapped in #if clauses to support platforms that don't have __float128 (I'm also very open to volunteers, as this is not currently a high priority for me). Once this is done, I can make a pull request.