I suppose this: immutable long DIM = 1024L*1024L *128L; immutable(double)[] signal = new double[DIM+1]; static this() { for (long i=0L; i< DIM+1; i++) { signal[i] = (i+DIM)%7 + (i+DIM+1)%5; } } void main() { ... }