On Thursday, 26 February 2015 at 10:55:43 UTC, Kingsley wrote:
float oneDegree = (PI / 180.0);
float first = -(oneDegree * 10.0);
float second = (oneDegree * 10.0);
float step = 0.000001;
float[] r = iota(first,second,step).array;

writeln(r);

float item = 0.174531;
writeln(r.canFind(item));


// returns false for canFind - even though that float is in the array ???

also mark your float litteral with the f postfix. By default FP litterals are double...IIRC

float oneDegree = (PI / 180.0f);
float first = -(oneDegree * 10.0f);
float second = (oneDegree * 10.0f);
float step = 0.000001f;
float[] r = iota(first,second,step).array;

writeln(r);

float item = 0.174531f;
writeln(r.canFind(item));

Reply via email to