On 30.04.2025 10:25, Tim Taylor wrote:
Is it correct to say that R's conditional use of long double is around ensuring 
things work on platforms which have 'long double' identical to 'double' types, 
as opposed to there being an odd compiler targeted that does not even have any 
concept of 'long double' type?

a double is 64 bit and stored that way on all platforms, the concept of long doubles is CPU specific. x86 chips have 80bit in the floating point units for calculations before rounding (and normalizing) to a regular double.

Some chips, e.g. those ARM chips used in current M[123]Macs (hence very relevant topic), do not support long doubles. And compilers offer to compile without support for long doubles which e.g. CRAN uses to check in an additional (issues) check.

Best,
Uwe Ligges


As background this was motivated by a query raised in the matrixStats package:
https://github.com/HenrikBengtsson/matrixStats/issues/278

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to