On Thursday, 29 August 2013 at 05:47:43 UTC, Paul Jurczak wrote:
I'm writing this rather ugly:
sqrt(cast(float)D) != round(sqrt(cast(float)D)
line and I'm looking for more concise notation without
introducing a meaningless variable to hold expression being
tested. Is there an equivalent of std.math.trunc(), which would
return fractional portion instead, maybe frac()?
I defined a helper function:
bool isIntegral(T)(T x) {return x == round(x);}
but is there something in D libraries to give me this
functionality?