Differences in results when using the same function in CTFE and Runtime

IchorDev zxinsworld at gmail.com
Mon Aug 12 11:06:15 UTC 2024


On Monday, 12 August 2024 at 10:22:52 UTC, Quirin Schroll wrote:
> On almost all non-embedded CPUs, doing non-vector calculations 
> in `float` is more costly than doing them in `double` or `real` 
> because for single-arguments, the floats are converted to 
> `double` or `real`. I consider `float` to be a type used for 
> storing values in arrays that don’t need the precision and save 
> me half the RAM.

I don’t care. Only one family of CPU architectures supports 
‘extended precision’ floats (because it’s a waste of time), so I 
would like to know a way to always perform calculations with 
double precision for better cross-platform consistency. Imagine 
trying to implement JRE without being able to do native double 
precision maths.


More information about the Digitalmars-d mailing list