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 GDC the answer is yes:
http://explore.dgnu.org/#%7B%22version%22%3A3%2C%22filterAsm%22%3A%7B%22labels%22%3Atrue%2C%22directives%2
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_precalcula
If I just type out sqrt(2.0) in D, is that automatically made
into a constant for me?
Thanks.