On Thursday, 11 February 2016 at 07:41:55 UTC, Enjoys Math wrote:
If I just type out sqrt(2.0) in D, is that automatically made into a constant for me?Thanks.
for DMD -O :
import std.math;
immutable foo = sqrt(2.0);
pure float precalculated()
{
return foo;
}
pure float not_precalculated()
{
return sqrt(2.0);
}
