iota to array

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Feb 25 06:42:09 UTC 2018


On Sun, Feb 25, 2018 at 06:22:03AM +0000, psychoticRabbit via Digitalmars-d-learn wrote:
[..]
>     printArray(doubleArr); // why is it printing ints instead of doubles??
[...]
> void printArray(T)(const ref T[] a) if (isArray!(T[]))
> {
>     foreach(t; a)
>         writeln(t);

Try:

	writefln("%.3f", t);

instead.


> }
> 
> ---------------------------------


T

-- 
Dogs have owners ... cats have staff. -- Krista Casada


More information about the Digitalmars-d-learn mailing list