Hi --

I've been trying to learn more about D's purity features after reading David Nadlinger's interesting post on this topic. While 'purifying' some existing code I discovered that I can't use roundTo in a pure function, and I don't understand why. Is this a general problem with most floating-point library calls? (e.g. I noticed std.math.floor() is impure as well).

"""
import std.conv;

int func(double d) pure {  // compiles...
        return to!int(d);
}

int func2(double d) pure {  //doesn't compile!?!
        return roundTo!int(d);
}
"""

Thanks for any pointers!

-Chris

Reply via email to